public void RedundantBind_Throw() { Action <Cat> method = o => Assert.Fail(); ContentPusher pusher = new ContentPusher(); pusher.Bind(method); pusher.Bind(method); }
public void Unbind_Throw() { Action <Cat> method = o => Assert.Fail(); ContentPusher pusher = new ContentPusher(); pusher.Bind(method); pusher.Unbind(method); pusher.Push(new Cat()); }
public void Deritive_Throw() { ContentPusher pusher = new ContentPusher(); pusher.Bind <Cat>(o => { Assert.Fail(); }); pusher.Push(new Animal { TestProp1 = 3 }); }
public void MultipleSubscribersUnbind_Assert() { bool a1Raised = false; Action <Cat> action1 = delegate { a1Raised = true; }; Action <Cat> action2 = delegate { }; ContentPusher pusher = new ContentPusher(); pusher.Bind(action1); pusher.Bind(action2); pusher.Unbind(action2); pusher.Push(new Cat()); Assert.IsTrue(a1Raised); }
public void BasicBindPush_Assert() { ContentPusher pusher = new ContentPusher(); bool fired = false; int val = 0; pusher.Bind <Animal>(o => { fired = true; val = o.TestProp1; }); pusher.Push(new Animal { TestProp1 = 3 }); Assert.IsTrue(fired && val == 3); }