예제 #1
0
        public void Test04()
        {
            var directory = new DefaultFileSystemDirectory(
                Path.Combine(
                    TestContext.CurrentContext.TestDirectory,
                    "../testData/TestDataBased/TestDataAssert/Test04/3act/emptyDir"));

            directory.CreateRecursivelyIfDoesNotExist();
            DoTest();
        }
예제 #2
0
        protected ExpectedActualDirPair GetDirPair()
        {
            var testDataRootDir       = GetTestDataDir();
            var expectedDirectoryPath = Path.Combine(testDataRootDir, "2exp");
            var expectedDataDir       = new DefaultFileSystemDirectory(expectedDirectoryPath);

            expectedDataDir.CreateRecursivelyIfDoesNotExist();
            var actualDirectoryPath = Path.Combine(testDataRootDir, "3act");
            var actualDataDir       = new DefaultFileSystemDirectory(actualDirectoryPath);

            actualDataDir.CreateRecursivelyIfDoesNotExist();
            var dirPair = new ExpectedActualDirPair(expectedDataDir, actualDataDir);

            return(dirPair);
        }
예제 #3
0
        public static void Using(IFileSystemDirectory testDataDir, Action <IFileSystemDirectory> actionOnActualDirectory)
        {
            var srcDir = new DefaultFileSystemDirectory(Path.Combine(testDataDir.DirectoryPath, "1src"));
            var expDir = new DefaultFileSystemDirectory(Path.Combine(testDataDir.DirectoryPath, "2exp"));
            var actDir = new DefaultFileSystemDirectory(Path.Combine(testDataDir.DirectoryPath, "3act"));

            actDir.Directory.Delete(".", true);
            if (srcDir.Directory.Exists("."))
            {
                DirectoryCopy(srcDir.DirectoryPath, actDir.DirectoryPath, true);
            }
            else
            {
                actDir.CreateRecursivelyIfDoesNotExist();
            }
            actionOnActualDirectory(actDir);
            TestDataAssert.DirectoriesAreEqual(expDir, actDir);
            actDir.Directory.Delete(".", true);
        }