Exemplo n.º 1
0
        public async Task GivenAMessageWhenAnExceptionOccursThenTheExceptionIsThrownAsync()
        {
            var handler = new TestableSynchronousBus();

            _ = await Assert.ThrowsAsync <NotImplementedException>(
                () => handler.InvokeAsync(new SerializableMessage()));
        }
Exemplo n.º 2
0
        public async Task GivenAMessageThenAResultIsReturnedAsync()
        {
            bool wasInvoked = false;
            var  expected   = new SerializableMessage();

            var handler = new TestableSynchronousBus(invoke: actual =>
            {
                wasInvoked = true;

                Assert.Equal(expected, actual);
            });

            await handler.InvokeAsync(expected);

            Assert.True(wasInvoked);
        }