public void BailsIfMethodDoesntExist () { PingSource source = new PingSource (); InstanceEventHandlerValue wirer = new InstanceEventHandlerValue (source, "Roo"); wirer.EventName = "Ping"; wirer.Wire (source, typeof (StaticPingListener)); }
public void BailsIfMethodDoesntExist () { PingSource source = new PingSource (); InstanceEventHandlerValue wirer = new InstanceEventHandlerValue (source, "Roo"); wirer.EventName = "Ping"; Assert.Throws<FatalObjectException>(() => wirer.Wire (source, typeof (StaticPingListener))); }
public void WireWithStaticHandler () { PingSource source = new PingSource (); InstanceEventHandlerValue wirer = new InstanceEventHandlerValue (source, "OnPing"); wirer.EventName = "Ping"; wirer.Wire (source, typeof (StaticPingListener)); }
public void BailsIfMethodDoesntExist() { PingSource source = new PingSource(); InstanceEventHandlerValue wirer = new InstanceEventHandlerValue(source, "Roo"); wirer.EventName = "Ping"; Assert.Throws <FatalObjectException>(() => wirer.Wire(source, typeof(StaticPingListener))); }
public void WireWithStaticHandler() { PingSource source = new PingSource(); InstanceEventHandlerValue wirer = new InstanceEventHandlerValue(source, "OnPing"); wirer.EventName = "Ping"; wirer.Wire(source, typeof(StaticPingListener)); }
public void BailsIfMethodDoesntExist() { PingSource source = new PingSource(); InstanceEventHandlerValue wirer = new InstanceEventHandlerValue(source, "Roo"); wirer.EventName = "Ping"; wirer.Wire(source, typeof(StaticPingListener)); }
public void Wire () { InstanceEventHandlerValue wirer = new InstanceEventHandlerValue (); wirer.EventName = "Ping"; wirer.MethodName = "OnPing"; PingSource source = new PingSource (); PingListener sink = new PingListener (); wirer.Wire (source, sink); source.OnPing (); Assert.IsTrue (sink.GotPing, "The event handler did not get notified when the event was raised."); Assert.AreEqual (1, sink.PingCount, "The event handler was not get notified exactly once when the event was raised exactly once."); }
public void Wire() { InstanceEventHandlerValue wirer = new InstanceEventHandlerValue(); wirer.EventName = "Ping"; wirer.MethodName = "OnPing"; PingSource source = new PingSource(); PingListener sink = new PingListener(); wirer.Wire(source, sink); source.OnPing(); Assert.IsTrue(sink.GotPing, "The event handler did not get notified when the event was raised."); Assert.AreEqual(1, sink.PingCount, "The event handler was not get notified exactly once when the event was raised exactly once."); }