public void InMemoryEvents_RegisterTwoHandlersForSameEventWithExactlyOneHandlerRestrictions_ThrowsInvalidOperationException() { var events = new InMemoryEvents(InMemoryEvents.RegistrationRequirements.ExactlyOnePerType); events.HandleEvent <SampleEvent>(x => { }); events.HandleEvent <SampleEvent>(x => { }); }
public WithoutPublishingTypesTests() { _inner = new InMemoryEvents(); _inner.RegisterEvent <SampleEvent>(x => { _eventWasPublished = true; return(Task.CompletedTask); }); _inner.RegisterEvent <SampleBlacklistedEvent>(x => { _eventWasPublished = true; return(Task.CompletedTask); }); }
public async Task InMemoryEvents_PublishEventWithoutRequiredHandler_ThrowsHandlerNotRegisteredException() { var events = new InMemoryEvents(InMemoryEvents.RegistrationRequirements.ExactlyOnePerType); await events.Publish(_sampleEvent); }