Esempio n. 1
0
        public void FilesInOneSubDir(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);

            CountLinesAndTest(myCreator.testStructRootDir, matchingFiles);
        }
Esempio n. 2
0
        public void FilesInRootDir(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);

            CountLinesAndTest(myCreator.testStructRootDir, matchingFiles);
        }
Esempio n. 3
0
        public void FilesInOneSubSubDir(int matchingFiles, int nonmatchingFiles)
        {
            // A sub-dir with 1, 1 files, plus a directory below that 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(@"dir1\dir2", "*.txt", nonmatchingFiles, testFiles);
            myCreator.CreateStruct(myContents);

            // Expect matchingFiles in dir2 plus one file from dir1.
            CountLinesAndTest(myCreator.testStructRootDir, matchingFiles + 1);
        }
Esempio n. 4
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();
            }
        }
Esempio n. 5
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();
            }
        }
Esempio n. 6
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();
            }
        }