public void GetDirectoryByNameWithNull() { // Setup var fileSystem = new PathTree <string>(); var directory = new PathDirectory <string>(fileSystem, @"x:\mydirectory"); // Execute directory.File(a_name: null); }
public void GetChildFileByName() { // Setup var created = DateTime.UtcNow; var lastModified = DateTime.UtcNow; var fileSystem = new PathTree <string>(); fileSystem.CreateFile(@"x:\mydirectory\file1.dat", "Value1"); fileSystem.CreateFile(@"x:\mydirectory\file2.dat", "Value2"); fileSystem.CreateFile(@"x:\mydirectory\file3.dat", "Value3"); fileSystem.CreateFile(@"x:\mydirectory\otherdirectory\file4.dat", "Value4"); var directory = new PathDirectory <string>(fileSystem, @"x:\mydirectory"); // Execute var result = directory.File("File1.dat"); // Assert Assert.AreEqual("File1.dat", result.Name); Assert.IsTrue(result.Exists); Assert.AreEqual("Value1", result.Value); }
public void GetFileByNameWithNull() { // Setup var fileSystem = new PathTree<string>(); var directory = new PathDirectory<string>(fileSystem, @"x:\mydirectory"); // Execute directory.File(a_name: null); }
public void GetChildFileByName() { // Setup var created = DateTime.UtcNow; var lastModified = DateTime.UtcNow; var fileSystem = new PathTree<string>(); fileSystem.CreateFile(@"x:\mydirectory\file1.dat", "Value1"); fileSystem.CreateFile(@"x:\mydirectory\file2.dat", "Value2"); fileSystem.CreateFile(@"x:\mydirectory\file3.dat", "Value3"); fileSystem.CreateFile(@"x:\mydirectory\otherdirectory\file4.dat", "Value4"); var directory = new PathDirectory<string>(fileSystem, @"x:\mydirectory"); // Execute var result = directory.File("File1.dat"); // Assert Assert.AreEqual("File1.dat", result.Name); Assert.IsTrue(result.Exists); Assert.AreEqual("Value1", result.Value); }