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"); }
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()); }
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()); }