コード例 #1
0
        public void ShouldNotInvokeHookAction_IfNotAcceptableEntityState(EntityState acceptableState, EntityState entityState)
        {
            var entry = SetupDbEntityEntry(new FooEntityStub(), entityState);
            var hook  = new DbHook <FooEntityStub>(stub => Assert.Fail("Hook invoked"), acceptableState);

            hook.HookEntry(entry);

            Assert.Pass("Hook not invoked");
        }
コード例 #2
0
        public void ShouldNotInvokeHookAction_IfNotAcceptableEntityType()
        {
            var entry = SetupDbEntityEntry(new object(), EntityState.Unchanged);
            var hook  = new DbHook <FooEntityStub>(stub => Assert.Fail("Hook invoked"));

            hook.HookEntry(entry);

            Assert.Pass("Hook not invoked");
        }