public void AssertionSucceedsIfCustomEventIsTriggered() { var thing = new EventMocker(); AssertExtension.TriggersEvent <EventMocker.CustomEventArgs>(x => thing.SomeTypedEvent += x, () => thing.TriggerTypedEvent()); }
public void AssertionFailsIfCustomEventIsTriggered() { var thing = new EventMocker(); Assert.ThrowsException <AssertFailedException>(() => AssertExtension.DoesNotTriggerEvent <EventMocker.CustomEventArgs>(x => thing.SomeTypedEvent += x, () => thing.TriggerTypedEvent())); }