Beispiel #1
0
        public async Task AddOutgoingMiddleware_AppliedToOutgoingMessages()
        {
            _sut.AddOutgoingMiddleware(ms => ms.Select(m =>
            {
                m.Text += "++";
                return(m);
            }));
            await Connect();

            _sut.OnNext(new BotMessage {
                Text = "foo"
            });

            await _api.Chat.Received().PostMessage(Arg.Is <Message>(m => m.Text == "foo++"));
        }
Beispiel #2
0
        public async Task AddOutgoingMiddleware_AppliedToOutgoingMessages()
        {
            _sut.AddOutgoingMiddleware(ms => ms.Select(m =>
            {
                m.Text += "++";
                return(m);
            }));
            await Connect().ConfigureAwait(false);

            _sut.OnNext(new BotMessage {
                Text = "foo"
            });

            await _api.Chat.Received().PostMessage(Arg.Is <Message>(m => m.Text == "foo++"), Arg.Any <CancellationToken?>()).ConfigureAwait(false);
        }