Piotr Czajkowski 1 månad sedan
förälder
incheckning
ac8c000dc9
2 ändrade filer med 13 tillägg och 11 borttagningar
  1. 8 7
      ProcessFilesTests/ProcessFilesTests.cs
  2. 5 4
      ProcessFilesTests/ProcessFiles_UnitTests.cs

+ 8 - 7
ProcessFilesTests/ProcessFilesTests.cs

@@ -2,6 +2,7 @@
 using System.IO;
 using System.Linq;
 using Xunit;
+using FileOperations;
 
 namespace ProcessFilesTests
 {
@@ -39,7 +40,7 @@ namespace ProcessFilesTests
                 result = Path.GetFileName(value);
             }
 
-            var test = new FileOperations.ProcessFiles();
+            var test = new ProcessFiles();
             var errors = test.Process([TestFolder], "txt", TestAction);
             Assert.Empty(errors);
             Assert.Equal(ExpectedInFolder, result);
@@ -59,7 +60,7 @@ namespace ProcessFilesTests
                 result.Add(Path.GetFileName(value));
             }
 
-            var test = new FileOperations.ProcessFiles();
+            var test = new ProcessFiles();
             var errors = test.Process([TestFolder], "txt", TestAction, true);
             Assert.Empty(errors);
             Assert.True(CheckResult(result, expectedInSubFolder));
@@ -74,7 +75,7 @@ namespace ProcessFilesTests
                 result.Add(Path.GetFileName(value));
             }
 
-            var test = new FileOperations.ProcessFiles();
+            var test = new ProcessFiles();
             var errors = test.Process(["./testFiles/subFolder", TestFile], "txt", TestAction);
             Assert.Empty(errors);
             Assert.True(CheckResult(result, expectedInSubFolder));
@@ -89,7 +90,7 @@ namespace ProcessFilesTests
                 result = Path.GetFileName(value);
             }
 
-            var test = new FileOperations.ProcessFiles();
+            var test = new ProcessFiles();
             var errors = test.Process([TestFile], "txt", TestAction);
             Assert.Empty(errors);
             Assert.Equal(ExpectedInFolder, result);
@@ -104,7 +105,7 @@ namespace ProcessFilesTests
                 result = value;
             }
 
-            var test = new FileOperations.ProcessFiles();
+            var test = new ProcessFiles();
             var errors = test.Process(["./testFiles/test.txt"], "txt", TestAction);
             Assert.NotEmpty(errors);
             Assert.Empty(result);
@@ -119,7 +120,7 @@ namespace ProcessFilesTests
                 result = value;
             }
 
-            var test = new FileOperations.ProcessFiles();
+            var test = new ProcessFiles();
             var errors = test.Process([TestFile], "abc", TestAction);
             Assert.NotEmpty(errors);
             Assert.Empty(result);
@@ -134,7 +135,7 @@ namespace ProcessFilesTests
                 result.Add(Path.GetFileName(value));
             }
 
-            var test = new FileOperations.ProcessFiles();
+            var test = new ProcessFiles();
             var errors = test.Process([TestFolder], ["txt", "json"], TestAction, true);
             Assert.Empty(errors);
             Assert.True(CheckResult(result, expectedInSubFolderMultipleExtensions));

+ 5 - 4
ProcessFilesTests/ProcessFiles_UnitTests.cs

@@ -1,4 +1,5 @@
 using NSubstitute;
+using FileOperations;
 using FileOperations.Interfaces;
 using Xunit;
 
@@ -18,7 +19,7 @@ namespace ProcessFilesTests
             var fakeFileSystem = Substitute.For<IFileSystem>();
             fakeFileSystem.File.Exists(Arg.Any<string>()).Returns(false);
 
-            var test = new FileOperations.ProcessFiles(fakeFileSystem);
+            var test = new ProcessFiles(fakeFileSystem);
             var errors = test.Process(["./imaginaryFolder/imaginaryTest.txt"], "txt", TestAction);
             Assert.NotEmpty(errors);
             Assert.Empty(result);
@@ -39,7 +40,7 @@ namespace ProcessFilesTests
             fakeFileSystem.File.Exists(Arg.Any<string>()).Returns(true);
             fakeFileSystem.Path.GetExtension(Arg.Any<string>()).Returns(string.Empty);
 
-            var test = new FileOperations.ProcessFiles(fakeFileSystem);
+            var test = new ProcessFiles(fakeFileSystem);
             var errors = test.Process(["imaginaryNoExtension"], "abc", TestAction);
             Assert.NotEmpty(errors);
             Assert.Empty(result);
@@ -61,7 +62,7 @@ namespace ProcessFilesTests
             fakeFileSystem.File.Exists(Arg.Any<string>()).Returns(true);
             fakeFileSystem.Path.GetExtension(Arg.Any<string>()).Returns("def");
 
-            var test = new FileOperations.ProcessFiles(fakeFileSystem);
+            var test = new ProcessFiles(fakeFileSystem);
             var errors = test.Process(["imaginaryFile"], "abc", TestAction);
             Assert.NotEmpty(errors);
             Assert.Empty(result);
@@ -84,7 +85,7 @@ namespace ProcessFilesTests
             fakeFileSystem.Path.GetExtension(Arg.Any<string>()).Returns("txt");
 
             const string expectedValue = "imaginary.txt";
-            var test = new FileOperations.ProcessFiles(fakeFileSystem);
+            var test = new ProcessFiles(fakeFileSystem);
             var errors = test.Process([expectedValue], "txt", TestAction);
             Assert.Empty(errors);
             Assert.Equal(expectedValue, result);