Example #1
0
        public void Verify_we_can_create_a_catch_event_from_base_type()
        {
            var listOfHandlers        = sut.GetAllHandlerFor(typeof(MyBaseDomainEvent));
            MyBaseDomainEvent evtbase = new MyBaseDomainEvent();

            foreach (var handler in listOfHandlers)
            {
                handler.Invoke(evtbase);
            }
            evtbase.CallCount.Should().Be.EqualTo(1);

            MyDerivedDomainEvent evtderived = new MyDerivedDomainEvent();

            foreach (var handler in listOfHandlers)
            {
                handler.Invoke(evtderived);
            }
            evtderived.CallCount.Should().Be.EqualTo(1);
        }
        public void Verify_we_can_create_a_catch_event_from_base_type()
        {
            var listOfHandlers = sut.GetAllHandlerFor(typeof(MyBaseDomainEvent));
            MyBaseDomainEvent evtbase = new MyBaseDomainEvent();
            foreach (var handler in listOfHandlers)
            {
                handler.Invoke(evtbase);
            }
            evtbase.CallCount.Should().Be.EqualTo(1);

            MyDerivedDomainEvent evtderived = new MyDerivedDomainEvent();
            foreach (var handler in listOfHandlers)
            {
                handler.Invoke(evtderived);
            }
            evtderived.CallCount.Should().Be.EqualTo(1);
        }
 public void handle_can_call_me_whathever_u_wanna(MyBaseDomainEvent baseEvent)
 {
     baseEvent.CallCount++;
 }
Example #4
0
 public void handle_can_call_me_whathever_u_wanna(MyBaseDomainEvent baseEvent)
 {
     baseEvent.CallCount++;
 }