public void SafeInvokeWithEventArgs_ArgsSpecified_RaisesEventWithArgs() { // Assemble bool ran = false; var eventy = new Eventy(); eventy.Handler += (s, e) => { ran = true; Assert.AreEqual(_sender, s); Assert.AreEqual(_eventArgs, e); }; // Act eventy.Raise(_sender, _eventArgs); // Assert Assert.IsTrue(ran); }
public void SafeInvokeNoEventArgs_NonNullEventHandler_RaisesEventWithEmptyArgs() { // Assemble bool ran = false; Eventy eventy = new Eventy(); eventy.Handler += (s, e) => { ran = true; Assert.AreEqual(_sender, s); Assert.AreEqual(EventArgs.Empty, e); }; // Act eventy.Raise(_sender); // Assert Assert.IsTrue(ran); }