Beispiel #1
0
        public async Task send_a_command_should_send_a_command_to_the_message_transport()
        {
            await bus.Start();

            var message = new AppleCommand();

            await bus.Send(message);

            await messageTransport.Received().Send(message, bus.MessageTypeToNameSendingCommandMap[message.GetType()]);
        }
Beispiel #2
0
        public async Task send_a_command_should_send_a_command_to_the_message_transport()
        {
            await bus.Start();

            var message = new AppleCommand();

            await bus.Send(message);

            await messageTransport.Received().Send(message, bus.GetMessageTypeNameByType(message.GetType()));
        }
Beispiel #3
0
    // Use this for initialization
    void Start()
    {
        Receiver   receiver = new Receiver();
        AbsCommand command  = new AppleCommand(receiver);
        Invoker    invoker  = new Invoker();

        invoker.SendCommand(command);
        invoker.ExecuteCommand();
        command = new StrawberryCommand(receiver);
        invoker.SendCommand(command);
        invoker.ExecuteCommand();
    }
Beispiel #4
0
        public async Task send_a_message_with_send_options_should_send_a_command_to_the_message_transport()
        {
            await bus.Start();

            var message = new AppleCommand();
            var options = new SendOptions();

            options.SetHeaders("color", "red");
            options.SetHeaders("dents", "4");

            await bus.Send(message, options);

            await messageTransport.Received().Send(message, bus.MessageTypeToNameSendingCommandMap[message.GetType()], options);
        }