Exemplo n.º 1
0
        public void GetChildFilesWithNullSearchPattern()
        {
            // Setup
            var fileSystem = new PathTree <string>();
            var directory  = new PathDirectory <string>(fileSystem, @"x:\mydirectory");

            // Execute
            directory.Files(a_pattern: null);
        }
Exemplo n.º 2
0
        public void GetChildFilesBySearchPattern()
        {
            // Setup
            var fileSystem = new PathTree <string>();

            fileSystem.CreateFile(@"x:\mydirectory\file1.dat", "Value");
            fileSystem.CreateFile(@"x:\mydirectory\file2.dat", "Value");
            fileSystem.CreateFile(@"x:\mydirectory\file3.css", "Value");
            fileSystem.CreateFile(@"x:\mydirectory\otherdirectory\file4.dat", "Value");
            var directory = new PathDirectory <string>(fileSystem, @"x:\mydirectory");

            // Execute
            var filePaths = directory.Files("*.css");

            // Assert
            Assert.AreEqual(1, filePaths.Count());
        }
Exemplo n.º 3
0
        public void GetChildFilesWithNullSearchPattern()
        {
            // Setup
            var fileSystem = new PathTree<string>();
            var directory = new PathDirectory<string>(fileSystem, @"x:\mydirectory");

            // Execute
            directory.Files(a_pattern: null);
        }
Exemplo n.º 4
0
        public void GetChildFilesBySearchPattern()
        {
            // Setup
            var fileSystem = new PathTree<string>();
            fileSystem.CreateFile(@"x:\mydirectory\file1.dat", "Value");
            fileSystem.CreateFile(@"x:\mydirectory\file2.dat", "Value");
            fileSystem.CreateFile(@"x:\mydirectory\file3.css", "Value");
            fileSystem.CreateFile(@"x:\mydirectory\otherdirectory\file4.dat", "Value");
            var directory = new PathDirectory<string>(fileSystem, @"x:\mydirectory");

            // Execute
            var filePaths = directory.Files("*.css");

            // Assert
            Assert.AreEqual(1, filePaths.Count());
        }