예제 #1
0
        public async Task PaymentRegisteredNotification_Test()
        {
            var paymentRegisteredNotificationHandler = new PaymentRegisteredNotificationHandler(EventsBus);

            var meetingGroupPaymentRegisterId = new MeetingGroupPaymentRegisterId(Guid.NewGuid());
            var dateTo       = new DateTime(2020, 1, 31);
            var notification = new PaymentRegisteredNotification(new PaymentRegisteredDomainEvent(meetingGroupPaymentRegisterId, dateTo), Guid.NewGuid());

            await paymentRegisteredNotificationHandler.Handle(notification, CancellationToken.None);

            var paymentRegisteredIntegrationEvent = EventsBus.GetLastPublishedEvent <PaymentRegisteredIntegrationEvent>();

            Assert.That(paymentRegisteredIntegrationEvent.MeetingGroupPaymentRegisterId, Is.EqualTo(meetingGroupPaymentRegisterId.Value));
            Assert.That(paymentRegisteredIntegrationEvent.DateTo, Is.EqualTo(dateTo));
        }
 public PaymentRegisteredDomainEvent(MeetingGroupPaymentRegisterId meetingGroupPaymentRegisterId, DateTime dateTo)
 {
     MeetingGroupPaymentRegisterId = meetingGroupPaymentRegisterId;
     DateTo = dateTo;
 }
 public MeetingGroupPaymentRegisterCreatedDomainEvent(MeetingGroupPaymentRegisterId meetingGroupPaymentRegisterId)
 {
     MeetingGroupPaymentRegisterId = meetingGroupPaymentRegisterId;
 }
예제 #4
0
 public async Task <MeetingGroupPaymentRegister> GetByIdAsync(MeetingGroupPaymentRegisterId paymentRegisterId)
 {
     return(await _paymentsContext.MeetingGroupPaymentRegisters.FirstOrDefaultAsync(x =>
                                                                                    x.Id == paymentRegisterId));
 }