public async Task HandledByIsRejectAfterRejectIsCalled() { var message = new FakeReceiverMessage("Hello, world!"); await message.RejectAsync(); message.HandledBy.Should().Be(nameof(message.RejectAsync)); }
public async Task HandledIsTrueAfterRejectIsCalled() { var message = new FakeReceiverMessage("Hello, world!"); await message.RejectAsync(); message.Handled.Should().BeTrue(); }
public async Task RejectThrowsIfHandledIsTrue() { var message = new FakeReceiverMessage("Hello, world!"); await message.AcknowledgeAsync(); Func <Task> act = () => message.RejectAsync(); act.Should().Throw <InvalidOperationException>() .WithMessage($"Cannot {nameof(message.RejectAsync)} message: the message has already been handled by {nameof(message.AcknowledgeAsync)}."); }