Beispiel #1
0
        private void validateMoveFiles(string workingDirectoryPath, string[] allFilePathsInSystem, string[] whitelistExtensions, string[] expectedWhitelistFilePaths, string[] expectedOutOfWhitelistFilePaths)
        {
            var mockFileSystem = new MockFileSystem();

            foreach (var item in allFilePathsInSystem)
            {
                mockFileSystem.AddFile(item, new MockFileData(new byte[] { 0x12 }));
            }

            var testFileSystem = new FileSystemForTesting(mockFileSystem);
            var sut            = new MoveAllFilesLogic(testFileSystem);

            sut.Begin(workingDirectoryPath, whitelistExtensions);

            sut.GetAllFilePaths(workingDirectoryPath)
            .Should()
            .BeEquivalentTo(expectedWhitelistFilePaths, "All whitelist files must be here.");

            var tempDirectoryPath = $"{workingDirectoryPath}temp\\";

            sut.GetAllFilePaths(tempDirectoryPath)
            .Should()
            .BeEquivalentTo(expectedOutOfWhitelistFilePaths, "All out of whitelist files must be here.");
        }