public void entityMemento_memento_changing_on_disposed_entity_using_base_iMemento_should_raise_ObjectDisposedException() { var memento = new ChangeTrackingService(); var target = new TestableMementoEntity(memento); target.Dispose(); ((IMemento)target).Memento = null; }
public void entityMemento_chacheChange_value_rejectCallback_commitCallback_addChangeBeahvior_on_disposed_object_should_raise_ObjectDisposedException() { var memento = new ChangeTrackingService(); var target = new TestableMementoEntity(memento); target.Dispose(); target.InvokeCacheChange("Foo", cv => { }, cv => { }, AddChangeBehavior.Default); }
public void entityMemento_chacheChangeOnRejectCallback_on_disposed_entity_should_raise_ObjectDisposedException() { var iChange = A.Dummy <IChange>(); var memento = A.Fake <IChangeTrackingService>(); A.CallTo(() => memento.IsSuspended).Returns(false); var target = new TestableMementoEntity(memento); target.Dispose(); var value = "foo"; var rejArgs = new ChangeRejectedEventArgs <string>(target, value, iChange, RejectReason.Revert); target.InvokeCacheChangeOnRejectCallback(value, cv => { }, cv => { }, rejArgs); }