public void SafeInvokeWithGenericArgs_ArgsNull_RaisesEventWithNullArgs() { // Assemble bool ran = false; var eventy = new GenericEventy(); eventy.Handler += (s, e) => { ran = true; Assert.AreEqual(_sender, s); Assert.IsNull(e); }; // Act eventy.Raise(_sender, null); // Assert Assert.IsTrue(ran); }
public void SafeInvokeWithGenericArgs_ArgsSpecified_RaisesEventWithArgs() { // Assemble bool ran = false; var eventy = new GenericEventy(); eventy.Handler += (s, e) => { ran = true; Assert.AreEqual(_sender, s); Assert.AreEqual(_genericEventArgs.Value, e); }; // Act eventy.Raise(_sender, _genericEventArgs); // Assert Assert.IsTrue(ran); }