示例#1
0
        public void TestCreateOneSubDir(int matchingFiles, int nonmatchingFiles)
        {
            var myCreator = new TestDirectoryStructureCreator();

            TestDirectoryContents[] myContents = new TestDirectoryContents[1];
            TestFile[] testFiles = CreateTestFiles(matchingFiles);
            myContents[0] = new TestDirectoryContents("dir1", "*.txt", nonmatchingFiles, testFiles);
            myCreator.CreateStruct(myContents);

            bool matched = StructureMatches(myContents, myCreator.testStructRootDir);

            if (matched && deleteWhenFinished)
            {
                myCreator.RemoveStruct();
            }
        }
示例#2
0
        public void TestCreateRootDirFiles(int matchingFiles, int nonmatchingFiles)
        {
            // Test varying numbers of files in the root dir.
            var myCreator = new TestDirectoryStructureCreator();

            TestDirectoryContents[] myContents = new TestDirectoryContents[1];
            TestFile[] testFiles = CreateTestFiles(matchingFiles);

            myContents[0] = new TestDirectoryContents("", "*.txt", nonmatchingFiles, testFiles);
            myCreator.CreateStruct(myContents);

            bool matched = StructureMatches(myContents, myCreator.testStructRootDir);

            if (matched && deleteWhenFinished)
            {
                myCreator.RemoveStruct();
            }
        }
示例#3
0
        public void TestCreateTwoSubDirs(int matchingFiles, int nonmatchingFiles)
        {
            // One sub-dir with 1, 1 files, plus a second sub-dir at the same level, with various combinations.
            var myCreator = new TestDirectoryStructureCreator();

            TestDirectoryContents[] myContents = new TestDirectoryContents[2];
            TestFile[] testFiles = CreateTestFiles(1);
            myContents[0] = new TestDirectoryContents("dir1", "*.txt", 1, testFiles);

            testFiles     = CreateTestFiles(matchingFiles);
            myContents[1] = new TestDirectoryContents("dir2", "*.txt", nonmatchingFiles, testFiles);

            myCreator.CreateStruct(myContents);

            bool matched = StructureMatches(myContents, myCreator.testStructRootDir);

            if (matched && deleteWhenFinished)
            {
                myCreator.RemoveStruct();
            }
        }