Skip to content

Commit

Permalink
cobrindo apontamentos do stryker
Browse files Browse the repository at this point in the history
  • Loading branch information
Daniel-iel committed May 30, 2024
1 parent f5404b1 commit b8289ca
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 5 deletions.
2 changes: 2 additions & 0 deletions src/ByReplace.Test/Mappers/DirectoryThreeTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@ public void MapThreeSources_WhenStartTheSourceMap_ShouldReturnTheThreeFile()
var nodes = dirThree.MapThreeSources(_brConfiguration.Path);

// Assert
_printMock.Verify(c => c.Information(It.IsAny<string>()), Times.Exactly(2));

Assert.Equal(2, nodes.Count);
Assert.Collection(nodes,
entry =>
Expand Down
24 changes: 19 additions & 5 deletions src/ByReplace.Test/Models/BrConfigurationTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ public void SetOnlyOneRule_WhenSetNewRule_ShouldReplaceOldRulesWithTheNewOne()
config.SetOnlyOneRule(newRule);

// Assert
Assert.Single(config.SkipDirectories);
Assert.Single(config.Rules);
}

[Fact]
Expand All @@ -89,8 +89,15 @@ public void ChangeDefaultPath_WhenChangePathToAPathThatDoesNotExists_ShouldRecei
// Arrange
var config = new BrConfiguration("C://ByReplace", ["**//Controllers/*"], []);

// Act && Assert
Assert.Throws<DirectoryNotFoundException>(() => config.ChangeDefaultPath("//FakeFolder"));
// Act
Action act = () =>
{
config.ChangeDefaultPath("//FakeFolder");
};

// Assert
DirectoryNotFoundException ex = Assert.Throws<DirectoryNotFoundException>(act);
Assert.Equal($"Path //FakeFolder does not exists.", ex.Message);
}

[Fact]
Expand All @@ -109,7 +116,14 @@ public void GetConfiguration_WhenGetConfigurationThatDoesNotExistsOnPath_ShouldR
// Arrange
var config = new BrConfiguration("C://ByReplace", ["**//Controllers/*"], []);

// Act && Assert
Assert.Throws<FileNotFoundException>(() => BrConfiguration.GetConfiguration("//FakeFolder"));
// Act
Action act = () =>
{
BrConfiguration.GetConfiguration("//FakeFolder");
};

// Assert
FileNotFoundException ex = Assert.Throws<FileNotFoundException>(act);
Assert.Equal($"BR Configuration not found on //FakeFolder path.", ex.Message);
}
}

0 comments on commit b8289ca

Please sign in to comment.