public void FileUnit_RollbackDelete_ReturnFalse() { // Arrange var unit = new FileUnit(); unit.Delete(this.DeleteFilePath); // Act unit.Commit(); unit.Rollback(); // Assert Assert.IsTrue(File.Exists(this.DeleteFilePath)); }
public void FileUnit_RollbackCopy_ReturnTrue() { // Arrange var unit = new FileUnit(); unit.Copy(this.CopyFilePath, this.CopybleFilePath, true); // Act unit.Commit(); unit.Rollback(); // Assert Assert.IsTrue(File.Exists(this.CopyFilePath) && !File.Exists(this.CopybleFilePath)); }
public void FileUnit_RollbackMove_ReturnTrue() { // Arrange var unit = new FileUnit(); unit.Move(this.MoveFilePath, this.MovebleFilePath); // Act unit.Commit(); unit.Rollback(); // Assert Assert.IsTrue(!File.Exists(this.MovebleFilePath) && File.Exists(this.MoveFilePath)); }
public void FileUnit_RollbackWriteAllText_ReturnTrue() { // Arrange var unit = new FileUnit(); unit.WriteAllText(this.WriteFilePath, this.AddedContent); // Act unit.Commit(); unit.Rollback(); // Assert string textInWriteFile = File.ReadAllText(this.WriteFilePath); Assert.AreEqual(textInWriteFile, this.Content); }