Example #1
0
        public void entityMemento_isTracking_with_suspended_serviceand_registerAsTransient_true_should_be_false()
        {
            var memento = new ChangeTrackingService();

            memento.Suspend();

            var target = new TestableMementoEntity(memento, true);

            target.GetIsTracking().Should().Be.False();
        }
Example #2
0
        public void entityMemento_chacheChange_value_rejectCallback_commitCallback_addChangeBeahvior_with_suspended_service_should_not_be_called()
        {
            var memento = new ChangeTrackingService();

            memento.Suspend();

            var target = new TestableMementoEntity(memento);

            var change = target.InvokeCacheChange("Foo", cv => { }, cv => { }, AddChangeBehavior.Default);

            change.Should().Be.Null();
        }
Example #3
0
        public void entityMemento_ctor_requesting_transient_registration_using_base_iMemento_to_suspended_memento_do_not_register_entity_as_transient()
        {
            EntityTrackingStates expected = EntityTrackingStates.None;

            using (var svc = new ChangeTrackingService())
            {
                svc.Suspend();

                var target = new FakeMementoEntity(true);
                ((IMemento)target).Memento = svc;

                EntityTrackingStates actual = svc.GetEntityState(target);

                actual.Should().Be.EqualTo(expected);
            }
        }