コード例 #1
0
        public void GetWrappedDirectory()
        {
            var concreteDir = target.SubDirectory("c");

            concreteDir.Create();
            concreteDir.File("ab.txt").Create("Foo Bar");
            var dir  = sut.SubDirectory("c");
            var file = dir.File("ab.txt");

            Assert.True(dir is RelativeDirectory);
            Assert.True(file is RelativeFile);
            file.AssertContent("Foo Bar");
        }
コード例 #2
0
        public void MakePhotoFile()
        {
            IDirectory root = new MockDirectory("x:\\rootDir");
            var        f    = root.NewPhotoFile("jpg");

            f.Create("sss");
            Assert.Equal("jpg", f.Extension());
            Assert.Single(root.SubDirectory("Photos").AllFiles());
        }
コード例 #3
0
        public async Task MoveWithSubDirectory()
        {
            var mockDirectory1 = new MockDirectoryTreeBuilder().Folder("F1").Object;

            mockDirectory1.Create();
            var mockDirectory2 = new MockDirectory("c:\\Mock2");

            await mockDirectory2.MoveFrom(mockDirectory1);

            Assert.False(mockDirectory1.SubDirectory("F1").Exists());
            Assert.True(mockDirectory2.SubDirectory("F1").Exists());
        }