Esempio n. 1
0
        public async Task CreatePaymentRegister_Test()
        {
            var meetingGroupProposalId = Guid.NewGuid();
            var registerId             = await PaymentsModule.ExecuteCommandAsync(
                new CreatePaymentRegisterCommand(Guid.NewGuid(), meetingGroupProposalId));

            var paymentRegister = await PaymentsModule.ExecuteQueryAsync(new GetMeetingGroupPaymentRegisterQuery(registerId));

            Assert.That(paymentRegister.Id, Is.EqualTo(registerId));
        }
        public async Task CreatePayer_Test()
        {
            var payerId = await PaymentsModule.ExecuteCommandAsync(
                new CreatePayerCommand(Guid.NewGuid(),
                                       PayerSampleData.Id, PayerSampleData.Login, PayerSampleData.Email, PayerSampleData.FirstName,
                                       PayerSampleData.LastName, PayerSampleData.Name));

            var payer = await PaymentsModule.ExecuteQueryAsync(new GetPayerQuery(payerId));

            Assert.That(payer.Id, Is.EqualTo(PayerSampleData.Id));
            Assert.That(payer.Login, Is.EqualTo(PayerSampleData.Login));
            Assert.That(payer.Name, Is.EqualTo(PayerSampleData.Name));
            Assert.That(payer.FirstName, Is.EqualTo(PayerSampleData.FirstName));
            Assert.That(payer.LastName, Is.EqualTo(PayerSampleData.LastName));
            Assert.That(payer.Email, Is.EqualTo(PayerSampleData.Email));
        }
Esempio n. 3
0
        public async Task CreateMeetingPayment_Test()
        {
            PayerId   payerId   = new PayerId(Guid.NewGuid());
            MeetingId meetingId = new MeetingId(Guid.NewGuid());
            decimal   value     = 100;
            string    currency  = "EUR";
            await PaymentsModule.ExecuteCommandAsync(new CreateMeetingPaymentCommand(Guid.NewGuid(),
                                                                                     payerId, meetingId, value, currency));

            var payment = await PaymentsModule.ExecuteQueryAsync(new GetMeetingPaymentQuery(meetingId.Value, payerId.Value));

            Assert.That(payment.PayerId, Is.EqualTo(payerId.Value));
            Assert.That(payment.MeetingId, Is.EqualTo(meetingId.Value));
            Assert.That(payment.FeeValue, Is.EqualTo(value));
            Assert.That(payment.FeeCurrency, Is.EqualTo(currency));
        }
Esempio n. 4
0
        public async Task RegisterPayment_Test()
        {
            var meetingGroupProposalId = Guid.NewGuid();

            var registerId = await PaymentsModule.ExecuteCommandAsync(
                new CreatePaymentRegisterCommand(Guid.NewGuid(), meetingGroupProposalId));

            var startDate = new DateTime(2020, 1, 1);
            var endDate   = new DateTime(2020, 1, 31);

            await PaymentsModule.ExecuteCommandAsync(new RegisterPaymentCommand(registerId, startDate, endDate));

            var payments = await PaymentsModule.ExecuteQueryAsync(new GetMeetingGroupPaymentsQuery(registerId));

            Assert.That(payments[0].MeetingGroupPaymentRegisterId, Is.EqualTo(registerId));
            Assert.That(payments[0].PaymentTermStartDate, Is.EqualTo(startDate));
            Assert.That(payments[0].PaymentTermEndDate, Is.EqualTo(endDate));
            Assert.That(payments[0].PayerId, Is.EqualTo(ExecutionContext.UserId));

            var paymentRegisteredNotification = await GetLastOutboxMessage <PaymentRegisteredNotification>();

            Assert.That(paymentRegisteredNotification.DomainEvent.DateTo, Is.EqualTo(endDate));
            Assert.That(paymentRegisteredNotification.DomainEvent.MeetingGroupPaymentRegisterId.Value, Is.EqualTo(registerId));
        }