diff --git a/src/ByReplace.Test/Mappers/DirectoryThreeTest.cs b/src/ByReplace.Test/Mappers/DirectoryThreeTest.cs index c20df6d..c31884d 100644 --- a/src/ByReplace.Test/Mappers/DirectoryThreeTest.cs +++ b/src/ByReplace.Test/Mappers/DirectoryThreeTest.cs @@ -58,6 +58,8 @@ public void MapThreeSources_WhenStartTheSourceMap_ShouldReturnTheThreeFile() var nodes = dirThree.MapThreeSources(_brConfiguration.Path); // Assert + _printMock.Verify(c => c.Information(It.IsAny()), Times.Exactly(2)); + Assert.Equal(2, nodes.Count); Assert.Collection(nodes, entry => diff --git a/src/ByReplace.Test/Models/BrConfigurationTest.cs b/src/ByReplace.Test/Models/BrConfigurationTest.cs index 83c5aca..62f51f7 100644 --- a/src/ByReplace.Test/Models/BrConfigurationTest.cs +++ b/src/ByReplace.Test/Models/BrConfigurationTest.cs @@ -67,7 +67,7 @@ public void SetOnlyOneRule_WhenSetNewRule_ShouldReplaceOldRulesWithTheNewOne() config.SetOnlyOneRule(newRule); // Assert - Assert.Single(config.SkipDirectories); + Assert.Single(config.Rules); } [Fact] @@ -89,8 +89,15 @@ public void ChangeDefaultPath_WhenChangePathToAPathThatDoesNotExists_ShouldRecei // Arrange var config = new BrConfiguration("C://ByReplace", ["**//Controllers/*"], []); - // Act && Assert - Assert.Throws(() => config.ChangeDefaultPath("//FakeFolder")); + // Act + Action act = () => + { + config.ChangeDefaultPath("//FakeFolder"); + }; + + // Assert + DirectoryNotFoundException ex = Assert.Throws(act); + Assert.Equal($"Path //FakeFolder does not exists.", ex.Message); } [Fact] @@ -109,7 +116,14 @@ public void GetConfiguration_WhenGetConfigurationThatDoesNotExistsOnPath_ShouldR // Arrange var config = new BrConfiguration("C://ByReplace", ["**//Controllers/*"], []); - // Act && Assert - Assert.Throws(() => BrConfiguration.GetConfiguration("//FakeFolder")); + // Act + Action act = () => + { + BrConfiguration.GetConfiguration("//FakeFolder"); + }; + + // Assert + FileNotFoundException ex = Assert.Throws(act); + Assert.Equal($"BR Configuration not found on //FakeFolder path.", ex.Message); } }