public void AssertionFailsIfEventDoesNotTrigger() { var thing = new EventMocker(); Assert.ThrowsException <AssertFailedException>(() => AssertExtension.TriggersEvent(x => thing.SomeEvent += x, () => thing.SomethingUnrelated())); }
public void AssertionFailsIfAnExceptionIsThrownCustom() { var thing = new EventMocker(); Assert.ThrowsException <InvalidOperationException>(() => AssertExtension.TriggersEvent <EventMocker.CustomEventArgs>(x => thing.SomeTypedEvent += x, () => thing.ThrowException())); }
public void AssertionSucceedsIfCustomEventIsTriggered() { var thing = new EventMocker(); AssertExtension.TriggersEvent <EventMocker.CustomEventArgs>(x => thing.SomeTypedEvent += x, () => thing.TriggerTypedEvent()); }
public void AssertionSucceedsIfEventIsTriggered() { var thing = new EventMocker(); AssertExtension.TriggersEvent(x => thing.SomeEvent += x, () => thing.TriggerEvent()); }