public void UndoAllEdit_before_begin_edit() { MockEntity entity = new MockEntity() { IntProperty = 1 }; Should.Throw <ArgumentNullException>(() => entity.UndoAllEdit()); }
public void UndoAllEdit() { int before = 1; int after = 2; MockEntity entity = new MockEntity() { IntProperty = before }; entity.BeginEdit(); entity.IntProperty = after; entity.UndoAllEdit(); Assert.AreEqual(before, entity.IntProperty); Assert.IsTrue(entity.IsEditing); }