Exemplo n.º 1
0
        public void CanInvokeCallback()
        {
            var fakeBus = new FakeBus();
            var callbacks = new List<string>();

            fakeBus.On<MessageSent>(e => callbacks.Add($"message sent: {e.CommandMessage}"));

            fakeBus.Send("whatever").Wait();

            Assert.That(callbacks, Is.EqualTo(new[] {"message sent: whatever"}));
        }
Exemplo n.º 2
0
    public void CanInvokeCallback()
    {
        var fakeBus   = new FakeBus();
        var callbacks = new List <string>();

        fakeBus.On <MessageSent>(e => callbacks.Add($"message sent: {e.CommandMessage}"));

        fakeBus.Send("whatever").Wait();

        Assert.That(callbacks, Is.EqualTo(new[] { "message sent: whatever" }));
    }