Exemple #1
0
        public void CopyToWithNotExistingSource()
        {
            // Setup
            var pathTree = new PathTree <string>();

            pathTree.CreateDirectory(@"x:\directory");
            var file = new PathFile <string>(pathTree, @"x:\directory\File.bmp");
            var dest = new PathFile <string>(pathTree, @"x:\directory\file2.bmp");

            // Execute
            file.CopyTo(dest);
        }
Exemple #2
0
        //[TestMethod]
        public void Temp()
        {
            var fileSystem = new TestFileSystem();
            var pathTree   = new PathTree <IFile>();

            pathTree.CreateDirectory(@"urban stuff");
            pathTree.CreateFile(@"urban stuff\urban1.hsf", fileSystem.StageFile(@"x:\root\urban stuff\urban1.hsf"));
            pathTree.CreateFile(@"urban stuff\urban1.jpg", fileSystem.StageFile(@"x:\root\urban stuff\urban1.jpg"));
            pathTree.CreateFile(@"urban stuff\urban2.hsf", fileSystem.StageFile(@"x:\root\urban stuff\urban2.hsf"));
            pathTree.CreateFile(@"urban stuff\urban2.jpg", fileSystem.StageFile(@"x:\root\urban stuff\urban2.jpg"));
            pathTree.CreateFile(@"urban stuff\urban3.hsf", fileSystem.StageFile(@"x:\root\urban stuff\urban3.hsf"));
            pathTree.CreateFile(@"urban stuff\urban3.jpg", fileSystem.StageFile(@"x:\root\urban stuff\urban3.jpg"));
            pathTree.CreateDirectory(@"curved case stuff");
            pathTree.CreateFile(@"curved case stuff\curved1.hsf", fileSystem.StageFile(@"x:\root\curved case stuff\curved1.hsf"));
            pathTree.CreateFile(@"curved case stuff\curved1.jpg", fileSystem.StageFile(@"x:\root\curved case stuff\curved1.jpg"));
            pathTree.CreateFile(@"curved case stuff\curved2.hsf", fileSystem.StageFile(@"x:\root\curved case stuff\curved2.hsf"));
            pathTree.CreateFile(@"curved case stuff\curved2.jpg", fileSystem.StageFile(@"x:\root\curved case stuff\curved2.jpg"));
            pathTree.CreateFile(@"curved case stuff\curved3.hsf", fileSystem.StageFile(@"x:\root\curved case stuff\curved3.hsf"));
            pathTree.CreateFile(@"curved case stuff\curved3.jpg", fileSystem.StageFile(@"x:\root\curved case stuff\curved3.jpg"));

            IFile file        = new PathFile <IFile>(pathTree, @"urban stuff\urban1.hsf");
            IFile destination = new PathFile <IFile>(pathTree, @"curved case stuff\carved urban1.esa");

            if (file.Exists)
            {
                file.CopyTo(destination);
            }

            file        = file.ChangeExtension(".jpg");
            destination = destination.ChangeExtension(".jpg");

            if (file.Exists)
            {
                file.CopyTo(destination);
            }

            Assert.IsFalse(pathTree.FileExists(@"urban stuff\urban1.hsf"));
            Assert.IsTrue(pathTree.FileExists(@"curved case stuff\carved urban1.esa"));
        }
Exemple #3
0
        //[TestMethod]
        public void Temp()
        {
            var fileSystem = new TestFileSystem();
            var pathTree = new PathTree<IFile>();
            pathTree.CreateDirectory(@"urban stuff");
            pathTree.CreateFile(@"urban stuff\urban1.hsf", fileSystem.StageFile(@"x:\root\urban stuff\urban1.hsf"));
            pathTree.CreateFile(@"urban stuff\urban1.jpg", fileSystem.StageFile(@"x:\root\urban stuff\urban1.jpg"));
            pathTree.CreateFile(@"urban stuff\urban2.hsf", fileSystem.StageFile(@"x:\root\urban stuff\urban2.hsf"));
            pathTree.CreateFile(@"urban stuff\urban2.jpg", fileSystem.StageFile(@"x:\root\urban stuff\urban2.jpg"));
            pathTree.CreateFile(@"urban stuff\urban3.hsf", fileSystem.StageFile(@"x:\root\urban stuff\urban3.hsf"));
            pathTree.CreateFile(@"urban stuff\urban3.jpg", fileSystem.StageFile(@"x:\root\urban stuff\urban3.jpg"));
            pathTree.CreateDirectory(@"curved case stuff");
            pathTree.CreateFile(@"curved case stuff\curved1.hsf", fileSystem.StageFile(@"x:\root\curved case stuff\curved1.hsf"));
            pathTree.CreateFile(@"curved case stuff\curved1.jpg", fileSystem.StageFile(@"x:\root\curved case stuff\curved1.jpg"));
            pathTree.CreateFile(@"curved case stuff\curved2.hsf", fileSystem.StageFile(@"x:\root\curved case stuff\curved2.hsf"));
            pathTree.CreateFile(@"curved case stuff\curved2.jpg", fileSystem.StageFile(@"x:\root\curved case stuff\curved2.jpg"));
            pathTree.CreateFile(@"curved case stuff\curved3.hsf", fileSystem.StageFile(@"x:\root\curved case stuff\curved3.hsf"));
            pathTree.CreateFile(@"curved case stuff\curved3.jpg", fileSystem.StageFile(@"x:\root\curved case stuff\curved3.jpg"));

            IFile file = new PathFile<IFile>(pathTree, @"urban stuff\urban1.hsf");
            IFile destination = new PathFile<IFile>(pathTree, @"curved case stuff\carved urban1.esa");

            if (file.Exists)
                file.CopyTo(destination);

            file = file.ChangeExtension(".jpg");
            destination = destination.ChangeExtension(".jpg");

            if (file.Exists)
                file.CopyTo(destination);

            Assert.IsFalse(pathTree.FileExists(@"urban stuff\urban1.hsf"));
            Assert.IsTrue(pathTree.FileExists(@"curved case stuff\carved urban1.esa"));
        }
Exemple #4
0
        public void CopyToWithNotExistingSource()
        {
            // Setup
            var pathTree = new PathTree<string>();
            pathTree.CreateDirectory(@"x:\directory");
            var file = new PathFile<string>(pathTree, @"x:\directory\File.bmp");
            var dest = new PathFile<string>(pathTree, @"x:\directory\file2.bmp");

            // Execute
            file.CopyTo(dest);
        }