예제 #1
0
        public void MovingDirectory_MovesContents()
        {
            var fileA = new TFile()
            {
                Name = "a"
            };
            var fileB = new TFile()
            {
                Name = "b"
            };

            filesystem.AddFile(fileA, "/originalDir", true);
            filesystem.AddFile(fileB, "/originalDir/subDir", true);

            filesystem.AddFile(new Directory("newDirectory"), filesystem.RootDirectory);

            filesystem.MoveFile("/originalDir", "/newDirectory");

            Assert.That(filesystem.FileExistsAtPath("/newDirectory/originalDir"));

            Assert.That(filesystem.GetPathOfFile(fileA), Is.EqualTo("/newDirectory/originalDir/a"));
            Assert.That(filesystem.GetPathOfFile(fileB), Is.EqualTo("/newDirectory/originalDir/subDir/b"));
        }