public async Task Handle_TicketScanValueResult_EventPublished() { // Arrange var identifier = "09__blOoQm72n8Bf"; var ticketScanResult = new TicketScanResult(true, "Benjamin Rich Swift"); var ticketScanModel = new TicketScanModel(identifier, new SeatModel(5, 'D')); var notification = new TicketScanResultNotification(identifier, ticketScanResult); _ticketRepository.Setup(callTo => callTo.Find(identifier)).Returns(ticketScanModel); // Act await _ticketScanRelayer.Handle(notification, default); // Assert _eventAggregator.Verify(callTo => callTo.Publish(It.Is <TicketScanUpdated>(message => message.Identifier.Equals(identifier))), Times.Once); }
public TicketScanResultNotification(string identifier, TicketScanResult result) { Identifier = identifier; Result = result; }