Esempio n. 1
0
        public async Task InvokeManyCommands_CorrelationId_Bus_is_required()
        {
            var commands = fixture.CreateMany <TestCommand>().ToArray();

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

            await BusExtensions.InvokeManyCommands(null, commands, correlationId);
        }
Esempio n. 2
0
        public async Task InvokeManyCommands_no_exception_if_commands_is_null()
        {
            IEnumerable <TestCommand> commands = null;

            await BusExtensions.InvokeManyCommands(mockBus.Object, commands);

            mockBus.Verify(p => p.InvokeCommand(It.IsAny <TestCommand>()), Times.Never);
        }
Esempio n. 3
0
        public async Task InvokeManyCommands_forwards_to_IBus()
        {
            var commands = fixture.CreateMany <TestCommand>().ToArray();

            await BusExtensions.InvokeManyCommands(mockBus.Object, commands);

            mockBus.Verify(p => p.InvokeCommand(It.IsAny <TestCommand>()), Times.Exactly(commands.Length));
        }
Esempio n. 4
0
        public async Task InvokeManyCommands_CorrelationId_no_exception_if_commands_is_null()
        {
            IEnumerable <TestCommand> commands = null;

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

            await BusExtensions.InvokeManyCommands(mockBus.Object, commands, correlationId);

            mockBus.Verify(p => p.InvokeCommand(It.IsAny <TestCommand>()), Times.Never);
        }
Esempio n. 5
0
        public async Task InvokeManyCommands_Bus_is_required()
        {
            var commands = fixture.CreateMany <TestCommand>().ToArray();

            await BusExtensions.InvokeManyCommands(null, commands);
        }