Beispiel #1
0
        public void GetChildDirectoryByNameWithNull()
        {
            // Setup
            var fileSystem = new PathTree <string>();
            var directory  = new PathDirectory <string>(fileSystem, @"x:\mydirectory");

            // Execute
            var result = directory.Directory(a_name: null);
        }
Beispiel #2
0
        public void GetNotExistingChildDirectoryByName()
        {
            // Setup
            var fileSystem = new PathTree <string>();

            fileSystem.CreateDirectory(@"x:\mydirectory\directory1");
            fileSystem.CreateDirectory(@"x:\mydirectory\directory2\child");
            fileSystem.CreateFile(@"x:\mydirectory\directory3\file.rgb", "Value");
            var directory = new PathDirectory <string>(fileSystem, @"x:\mydirectory");

            // Execute
            var result = directory.Directory("Directory4");

            // Assert
            Assert.AreEqual("Directory4", result.Name);
            Assert.IsFalse(result.Exists);
        }
Beispiel #3
0
        public void CustomTest_I()
        {
            var fileSystem = new PathTree <string>();

            fileSystem.CreateDirectory(@"\Root\Directory");
            fileSystem.CreateDirectory(@"\Root\Directory\Sub1");
            fileSystem.CreateDirectory(@"\Root\Directory\Sub2");
            fileSystem.CreateDirectory(@"\Root\Directory\Sub3");
            fileSystem.CreateFile(@"\Root\Directory\File1.hsf", "Value");
            fileSystem.CreateFile(@"\Root\Directory\File2.hsf", "Value");
            fileSystem.CreateFile(@"\Root\Directory\File3.hsf", "Value");

            var directory = new PathDirectory <string>(fileSystem, @"\");

            var result = directory.Directory(@"Root\Directory\Sub1").Exists;

            Assert.IsTrue(result);
        }
Beispiel #4
0
        public void GetNotExistingChildDirectoryByName()
        {
            // Setup
            var fileSystem = new PathTree<string>();
            fileSystem.CreateDirectory(@"x:\mydirectory\directory1");
            fileSystem.CreateDirectory(@"x:\mydirectory\directory2\child");
            fileSystem.CreateFile(@"x:\mydirectory\directory3\file.rgb", "Value");
            var directory = new PathDirectory<string>(fileSystem, @"x:\mydirectory");

            // Execute
            var result = directory.Directory("Directory4");

            // Assert
            Assert.AreEqual("Directory4", result.Name);
            Assert.IsFalse(result.Exists);
        }
Beispiel #5
0
        public void GetChildDirectoryByNameWithNull()
        {
            // Setup
            var fileSystem = new PathTree<string>();
            var directory = new PathDirectory<string>(fileSystem, @"x:\mydirectory");

            // Execute
            var result = directory.Directory(a_name: null);
        }
Beispiel #6
0
        public void CustomTest_I()
        {
            var fileSystem = new PathTree<string>();
            fileSystem.CreateDirectory(@"\Root\Directory");
            fileSystem.CreateDirectory(@"\Root\Directory\Sub1");
            fileSystem.CreateDirectory(@"\Root\Directory\Sub2");
            fileSystem.CreateDirectory(@"\Root\Directory\Sub3");
            fileSystem.CreateFile(@"\Root\Directory\File1.hsf", "Value");
            fileSystem.CreateFile(@"\Root\Directory\File2.hsf", "Value");
            fileSystem.CreateFile(@"\Root\Directory\File3.hsf", "Value");

            var directory = new PathDirectory<string>(fileSystem, @"\");

            var result = directory.Directory(@"Root\Directory\Sub1").Exists;

            Assert.IsTrue(result);
        }