Exemplo 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);
        }
Exemplo 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);
        }
Exemplo 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));
        }
Exemplo 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);
        }
Exemplo n.º 5
0
        public async Task InvokeManyCommands_Bus_is_required()
        {
            var commands = fixture.CreateMany <TestCommand>().ToArray();

            await BusExtensions.InvokeManyCommands(null, commands);
        }