public AddedPayeSchemeEventHandlerTestsFixture() { Context = new Mock <IMessageHandlerContext>(); Event = new AddedPayeSchemeEvent { AccountId = 12345, PayeRef = "ABC/1234565" }; Handler = new AddedPayeSchemeEventHandler(); }
public async Task Handle_WhenHandlingAddedPayeSchemeEvent_ThenShouldSendAddedPayeSchemeCommand( TestableMessageHandlerContext context, [Frozen] Mock <IMediator> mediator, AddedPayeSchemeEventHandler handler, AddedPayeSchemeEvent message) { //arrange //act await handler.Handle(message, context); //assert mediator.Verify(s => s.Send(It.Is <AddedPayeSchemeCommand>(c => c.AccountId == message.AccountId && c.Aorn == message.Aorn && c.CorrelationId == message.CorrelationId && c.PayeRef == message.PayeRef && c.SchemeName == message.SchemeName && c.UserName == message.UserName && c.UserRef == message.UserRef), It.IsAny <CancellationToken>())); }