public void TestInvoke_InvalidEventType() { DudSink s = new DudSink(); s.BadEvent += () => { }; s.InvokeEvent("BadEvent", EventArgs.Empty); }
public void TestInvoke_HandlerThrowsException_ThrowOnError() { DudSink s = new DudSink(); s.ThrowOnInvocationFailure = true; s.TestEvent += (se, e) => { throw new Exception(); }; s.InvokeEvent("TestEvent", this, EventArgs.Empty); }
public void TestInvoke_ValidSetup() { bool didInvoke = false; DudSink s = new DudSink(); s.TestEvent += (se, e) => { didInvoke = true; }; s.InvokeEvent("TestEvent", this, EventArgs.Empty); Assert.IsTrue(didInvoke); }
public void TestInvoke_HandlerThrowsException_DoNotThrowOnError() { bool didInvoke = false; DudSink s = new DudSink(); s.ThrowOnInvocationFailure = false; s.TestEvent += (se, e) => { didInvoke = true; throw new Exception(); }; s.InvokeEvent("TestEvent", this, EventArgs.Empty); Assert.IsTrue(didInvoke); }
public void TestInvoke_UnknownEvent() { EventSink s = new DudSink(); s.InvokeEvent("DoesNotExist", this, EventArgs.Empty); }
public void TestInvoke_NullSender() { EventSink s = new DudSink(); s.InvokeEvent("TestEvent", null, EventArgs.Empty); }
public void TestInvoke_EmptyEventName() { EventSink s = new DudSink(); s.InvokeEvent(string.Empty, EventArgs.Empty); }
public void TestInvoke_NullEventName() { EventSink s = new DudSink(); s.InvokeEvent(null, EventArgs.Empty); }