|
@@ -28,7 +28,7 @@ namespace ProcessFilesTests
|
|
|
}
|
|
|
|
|
|
[Fact]
|
|
|
- public void ProcessFileNotMatchExtensionTest()
|
|
|
+ public void ProcessFileNoExtensionTest()
|
|
|
{
|
|
|
var result = string.Empty;
|
|
|
void TestAction(string value)
|
|
@@ -48,5 +48,27 @@ namespace ProcessFilesTests
|
|
|
fakeFileSystem.File.Received().Exists(Arg.Any<string>());
|
|
|
fakeFileSystem.Path.Received().GetExtension(Arg.Any<string>());
|
|
|
}
|
|
|
+
|
|
|
+ [Fact]
|
|
|
+ public void ProcessFileNotMatchExtensionTest()
|
|
|
+ {
|
|
|
+ var result = string.Empty;
|
|
|
+ void TestAction(string value)
|
|
|
+ {
|
|
|
+ result = value;
|
|
|
+ }
|
|
|
+
|
|
|
+ var fakeFileSystem = Substitute.For<IFileSystem>();
|
|
|
+ fakeFileSystem.File.Exists(Arg.Any<string>()).Returns(true);
|
|
|
+ fakeFileSystem.Path.GetExtension(Arg.Any<string>()).Returns("def");
|
|
|
+
|
|
|
+ var test = new ProcessFiles.ProcessFiles(fakeFileSystem);
|
|
|
+ var errors = test.Process(["imaginaryFile"], "abc", TestAction);
|
|
|
+ Assert.NotEmpty(errors);
|
|
|
+ Assert.Empty(result);
|
|
|
+
|
|
|
+ fakeFileSystem.File.Received().Exists(Arg.Any<string>());
|
|
|
+ fakeFileSystem.Path.Received().GetExtension(Arg.Any<string>());
|
|
|
+ }
|
|
|
}
|
|
|
}
|