Ejemplo 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);
        }
Ejemplo 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);
        }
Ejemplo 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);
        }
Ejemplo 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();
            }
        }
Ejemplo 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();
            }
        }
Ejemplo 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();
            }
        }