public void TestDoubleAdd() { Msg1Sub sub = new Msg1Sub(); bus.RegisterSubscriber(sub); Assert.ThrowsException <System.ArgumentException>(() => bus.RegisterSubscriber(sub)); }
public void UnregisterHandler() { var sub = new Msg1Sub(); bus.RegisterSubscriber(sub); Assert.AreEqual(1, bus.SubscriberCount); bus.UnregisterSubscriber(sub); Assert.AreEqual(0, bus.SubscriberCount); bus.Send(new MyMessage1()); AssertHandleCounts(); }