public static DeleteDirectory ( string directory, string &errorMessage ) : bool | ||
directory | string | |
errorMessage | string | |
return | bool |
public void GetTempDirectory__DirectoryDoesExistAndCanBeDeleted() { string dir = Utils.GetTempDirectory(); Directory.Exists(dir).Should().BeTrue(); // ReSharper disable once UnusedVariable Utils.DeleteDirectory(dir, out string errorMessage).Should().BeTrue(); }
public void GetTempDirectory__DirectoryDoesExistAndCanBeDeleted() { string dir = Utils.GetTempDirectory(); Assert.IsTrue(Directory.Exists(dir)); string errorMessage; Assert.IsTrue(Utils.DeleteDirectory(dir, out errorMessage)); }
public void GetTempDirectory__DirectoryDoesExistAndCanBeDeleted() { string dir = Utils.GetTempDirectory(); Directory.Exists(dir).Should().BeTrue(); string errorMessage; Utils.DeleteDirectory(dir, out errorMessage).Should().BeTrue(); }
public void DeleteDirectory_CanNotBeDeleted_ReturnsFalseAndMessage() { string dir = Utils.GetTempDirectory(); SetReadonlyFlag(dir); string errorMessage; bool result = Utils.DeleteDirectory(dir, out errorMessage); result.Should().BeFalse(); errorMessage.Should().Contain(dir); RemoveReadonlyFlag(dir); result = Utils.DeleteDirectory(dir, out errorMessage); result.Should().BeTrue(); errorMessage.Should().BeNull(); }
public void DeleteDirectory_CanNotBeDeleted_ReturnsFalseAndMessage() { string dir = Utils.GetTempDirectory(); SetReadonlyFlag(dir); string errorMessage; bool result = Utils.DeleteDirectory(dir, out errorMessage); Assert.IsFalse(result); Assert.IsTrue(errorMessage.Contains(dir)); RemoveReadonlyFlag(dir); result = Utils.DeleteDirectory(dir, out errorMessage); Assert.IsTrue(result); Assert.IsNull(errorMessage); }