Beispiel #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"}));
        }
    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" }));
    }