Beispiel #1
0
        public void RaiseReferenceInitializatingEvent_InvokesMixinHook()
        {
            var domainObject  = _transaction.ExecuteInScope(() => HookedTargetClass.NewObject()); // indirect call of RaiseReferenceInitializatingEvent
            var mixinInstance = Mixin.Get <HookedDomainObjectMixin> (domainObject);

            Assert.That(mixinInstance.OnDomainObjectReferenceInitializingCalled, Is.True);
        }
Beispiel #2
0
        public void RaiseReferenceInitializatingEvent_InvokesMixinHook_WhilePropertyAccessForbidden()
        {
            var mixinInstance = new HookedDomainObjectMixin();

            mixinInstance.InitializationHandler += (sender, args) => Dev.Null = ((HookedDomainObjectMixin)sender).Target.Property;

            using (new MixedObjectInstantiationScope(mixinInstance))
            {
                _transaction.ExecuteInScope(() => HookedTargetClass.NewObject()); // indirect call of RaiseReferenceInitializatingEvent
            }
        }