Exemplo n.º 1
0
        public async Task InvokeManyCommandsAsync_forwards_all_to_bus(IBus bus, FirstTestCommand[] testCommands)
        {
            await BusExtensions.InvokeManyCommandsAsync(bus, testCommands);

            Mock.Get(bus).Verify(p => p.InvokeCommandAsync(It.IsAny <FirstTestCommand>(), It.IsAny <Guid>(), It.IsAny <IDictionary <string, string> >()), Times.Exactly(testCommands.Length));
        }
Exemplo n.º 2
0
 public void InvokeManyCommandsAsync_requires_bus(FirstTestCommand[] testCommands, Guid correlationId, IDictionary <string, string> headers)
 {
     Assert.ThrowsAsync <ArgumentNullException>(() => BusExtensions.InvokeManyCommandsAsync(null, testCommands, correlationId, headers));
 }
Exemplo n.º 3
0
        public async Task InvokeManyCommandsAsync_handles_null_command_list(IBus bus, Guid correlationId, IDictionary <string, string> headers)
        {
            await BusExtensions.InvokeManyCommandsAsync <FirstTestCommand>(bus, null, correlationId, headers);

            Mock.Get(bus).Verify(p => p.InvokeCommandAsync(It.IsAny <FirstTestCommand>(), It.IsAny <Guid>(), It.IsAny <IDictionary <string, string> >()), Times.Never);
        }
Exemplo n.º 4
0
 public void InvokeManyCommandsAsync_requires_bus(FirstTestCommand[] testCommands)
 {
     Assert.ThrowsAsync <ArgumentNullException>(() => BusExtensions.InvokeManyCommandsAsync(null, testCommands));
 }