Example #1
0
        public async Task RaiseManyEvents_forwards_to_IBus()
        {
            var events = fixture.CreateMany <TestEvent>().ToArray();

            await BusExtensions.RaiseManyEvents(mockBus.Object, events);

            mockBus.Verify(p => p.RaiseEvent(It.IsAny <TestEvent>()), Times.Exactly(events.Length));
        }
Example #2
0
        public async Task RaiseManyEvents_no_exception_if_commands_is_null()
        {
            IEnumerable <TestEvent> events = null;

            await BusExtensions.RaiseManyEvents(mockBus.Object, events);

            mockBus.Verify(p => p.RaiseEvent(It.IsAny <TestEvent>()), Times.Never);
        }
Example #3
0
        public async Task RaiseManyEvents_CorrelationId_Bus_is_required()
        {
            var events = fixture.CreateMany <TestEvent>().ToArray();

            var correlationId = fixture.Create <Guid>();

            await BusExtensions.RaiseManyEvents(null, events, correlationId);
        }
Example #4
0
        public async Task RaiseManyEvents_CorrelationId_no_exception_if_commands_is_null()
        {
            IEnumerable <TestEvent> events = null;

            var correlationId = fixture.Create <Guid>();

            await BusExtensions.RaiseManyEvents(mockBus.Object, events, correlationId);

            mockBus.Verify(p => p.RaiseEvent(It.IsAny <TestEvent>(), It.IsAny <Guid>()), Times.Never);
        }
Example #5
0
        public async Task RaiseManyEvents_Bus_is_required()
        {
            var events = fixture.CreateMany <TestEvent>().ToArray();

            await BusExtensions.RaiseManyEvents(null, events);
        }