Ejemplo n.º 1
0
        public void it_should_fire_ordered_by_order_of_registration()
        {
            AutoResetEventLatch secondaryLatch = new AutoResetEventLatch();

            _domainEventsHub.Register <CustomerChangedEvent>(delegate { _eventLatch.Set(); Thread.Sleep(100); });
            _domainEventsHub.Register <CustomerChangedEvent>(delegate { secondaryLatch.Set(); });

            _domainEventsHub.Raise(new CustomerChangedEvent());

            Assert.Greater(secondaryLatch.FireTime, _eventLatch.FireTime);
        }
Ejemplo n.º 2
0
 public void SetUp()
 {
     _eventLatch      = new AutoResetEventLatch();
     _domainEventsHub = new DomainEventHub();
     _staticLatch     = new AutoResetEventLatch();
 }
Ejemplo n.º 3
0
 public DeadObject(DomainEventHub ev, AutoResetEventLatch latch)
 {
     ev.Register <CustomerChangedEvent>(delegate { latch.Set(); });
 }
        public void it_should_fire_ordered_by_order_of_registration()
        {
            AutoResetEventLatch secondaryLatch = new AutoResetEventLatch();

            _domainEventsHub.Register<CustomerChangedEvent>(delegate { _eventLatch.Set(); Thread.Sleep(100); });
            _domainEventsHub.Register<CustomerChangedEvent>(delegate { secondaryLatch.Set(); });

            _domainEventsHub.Raise(new CustomerChangedEvent());

            Assert.Greater(secondaryLatch.FireTime, _eventLatch.FireTime);
        }
 public DeadObject(DomainEventHub ev, AutoResetEventLatch latch)
 {
     ev.Register<CustomerChangedEvent>(delegate{latch.Set();});
 }
 public void SetUp()
 {
     _eventLatch = new AutoResetEventLatch();
     _domainEventsHub = new DomainEventHub();
     _staticLatch = new AutoResetEventLatch();
 }