예제 #1
0
        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;
        }
예제 #2
0
        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);
        }
예제 #3
0
        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);
        }