public void Move() { IDirectory Temp = new ResourceDirectory("resource://FileCurator.Tests/"); IDirectory Temp2 = new LocalDirectory("./Testing/"); Temp2.Create(); while (!Temp2.Exists) { } Temp = Temp.MoveTo(Temp2); Assert.True(Temp.Exists); Assert.True(Temp2.Exists); Assert.Equal(Temp2.FullName, Temp.Parent.FullName + "\\"); int Count = 0; foreach (var Files in Temp.EnumerateFiles()) { Assert.NotEqual(0, Files.Length); ++Count; } Assert.Equal(1, Count); Temp2.Delete(); while (Temp2.Exists) { } }
public void Move() { var Temp = new WebDirectory("http://www.google.com", Client); var Temp2 = new LocalDirectory("./Testing/"); Temp2.Create(); while (!Temp2.Exists) { } Assert.Throws <HttpRequestException>(() => Temp.MoveTo(Temp2)); Assert.True(Temp.Exists); Assert.True(Temp2.Exists); int Count = 0; foreach (var Files in Temp2.EnumerateFiles()) { Assert.NotEqual(0, Files.Length); ++Count; } Assert.Equal(1, Count); Temp2.Delete(); }
public void Copy() { var Temp = new WebDirectory("http://www.google.com", Client); var Temp2 = new LocalDirectory("./Testing/"); Temp2.Create(); while (!Temp2.Exists) { } Temp.CopyTo(Temp2); Assert.True(Temp.Exists); Assert.True(Temp2.Exists); int Count = 0; foreach (var Files in Temp2.EnumerateFiles()) { Assert.NotEqual(0, Files.Length); ++Count; } Assert.Equal(1, Count); Temp2.Delete(); }