コード例 #1
0
        public void InMemoryEvents_RegisterTwoHandlersForSameEventWithExactlyOneHandlerRestrictions_ThrowsInvalidOperationException()
        {
            var events = new InMemoryEvents(InMemoryEvents.RegistrationRequirements.ExactlyOnePerType);

            events.HandleEvent <SampleEvent>(x => { });
            events.HandleEvent <SampleEvent>(x => { });
        }
コード例 #2
0
 public WithoutPublishingTypesTests()
 {
     _inner = new InMemoryEvents();
     _inner.RegisterEvent <SampleEvent>(x =>
     {
         _eventWasPublished = true;
         return(Task.CompletedTask);
     });
     _inner.RegisterEvent <SampleBlacklistedEvent>(x =>
     {
         _eventWasPublished = true;
         return(Task.CompletedTask);
     });
 }
コード例 #3
0
        public async Task InMemoryEvents_PublishEventWithoutRequiredHandler_ThrowsHandlerNotRegisteredException()
        {
            var events = new InMemoryEvents(InMemoryEvents.RegistrationRequirements.ExactlyOnePerType);

            await events.Publish(_sampleEvent);
        }