Ejemplo n.º 1
0
 public void Initialize()
 {
     _vent = EventAggregator.Instance;
     _consumer = new Consumer();
     _producer1 = new Producer("consume");
     _producer2 = new Producer("reconsume");
 }
Ejemplo n.º 2
0
 public void TestSubscribedConsumerCanReactToMultipleActions()
 {
     Producer producer = new Producer("multipleactions");
     Assert.AreEqual(0, _consumer.Counter);
     producer.TriggerEvent();
     Assert.AreEqual(3, _consumer.Counter);
     Assert.AreEqual("stringParam", _consumer.Param[0]);
 }
Ejemplo n.º 3
0
 public void TestUnsubscribedMultipleActions()
 {
     Producer producer = new Producer("multipleactions");
     Assert.AreEqual(0, _consumer.Counter);
     producer.TriggerEvent();
     Assert.AreEqual(3, _consumer.Counter);
     Assert.AreEqual("stringParam", _consumer.Param[0]);
     _vent.Unsubscribe(new EventTest("multipleactions"), new Action<dynamic>[] {_consumer.React, _consumer.ReactTwo});
     producer.TriggerEvent();
     Assert.AreEqual(3, _consumer.Counter);
     Assert.AreEqual("stringParam", _consumer.Param[0]);
 }