コード例 #1
0
 public void Verify_handler_of_derived_class()
 {
     var listOfHandlers = sut.GetAllHandlerFor(typeof(MyDerivedDomainEvent));
     MyDerivedDomainEvent evtderived = new MyDerivedDomainEvent();
     foreach (var handler in listOfHandlers)
     {
         handler.Invoke(evtderived);
     }
     evtderived.CallCountSpecific.Should().Be.EqualTo(1);
 }
コード例 #2
0
 public void Catch_derived_event(MyDerivedDomainEvent evt)
 {
     evt.CallCountSpecific++;
 }
コード例 #3
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);
        }