Exemplo n.º 1
0
        public async Task Stored_settings_should_be_retrieved(AgentUserSettings settings)
        {
            var agent = AgentInfoFactory.GetByAgentId(1);
            await _settingsManager.SetUserSettings(agent, settings);

            var storedSettings = await _settingsManager.GetUserSettings(agent);

            Assert.Equal(ApplyDefaultsToUserSettings(settings), storedSettings);
        }
Exemplo n.º 2
0
        public async Task Stored_settings_should_be_retrieved(string settings)
        {
            var agent = AgentInfoFactory.GetByAgentId(1);
            await _settingsManager.SetAppSettings(agent, settings);

            var storedSettings = await _settingsManager.GetAppSettings(agent);

            Assert.Equal(settings, storedSettings);
        }
Exemplo n.º 3
0
        public async Task When_invoice_not_found_should_fail()
        {
            var agentContext            = AgentInfoFactory.GetByAgentId(1);
            var bookingDocumentsService = CreateBookingDocumentsService(new Booking
            {
                Id      = 1,
                AgentId = 1,
                Status  = BookingStatuses.Pending
            }, false);

            var(isSuccess, _) = await bookingDocumentsService.GetActualInvoice(1, agentContext.AgentId);

            Assert.False(isSuccess);
        }
Exemplo n.º 4
0
        public async Task When_booking_has_allowed_status_generation_invoice_should_succeed(BookingStatuses status)
        {
            var agentContext            = AgentInfoFactory.GetByAgentId(1);
            var bookingDocumentsService = CreateBookingDocumentsService(new Booking
            {
                Id      = 1,
                AgentId = 1,
                Status  = status
            }, true);

            var(isSuccess, _) = await bookingDocumentsService.GetActualInvoice(1, agentContext.AgentId);

            Assert.True(isSuccess);
        }
Exemplo n.º 5
0
        public async Task When_booking_has_confirmed_status_and_payed_generation_voucher_should_succeed()
        {
            var agentContext            = AgentInfoFactory.GetByAgentId(1);
            var bookingDocumentsService = CreateBookingDocumentsService(new Booking
            {
                Id            = 1,
                AgentId       = 1,
                Status        = BookingStatuses.Confirmed,
                PaymentStatus = BookingPaymentStatuses.Authorized
            });

            var(isSuccess, _) = await bookingDocumentsService.GenerateVoucher(1, agentContext, default);

            Assert.True(isSuccess);
        }
Exemplo n.º 6
0
        public async Task When_booking_has_not_confirmed_status_generation_voucher_should_fail()
        {
            var agentContext            = AgentInfoFactory.GetByAgentId(1);
            var bookingDocumentsService = CreateBookingDocumentsService(new Booking
            {
                Id            = 1,
                AgentId       = 1,
                Status        = BookingStatuses.Cancelled,
                PaymentStatus = It.IsAny <BookingPaymentStatuses>()
            });

            var(isSuccess, _) = await bookingDocumentsService.GenerateVoucher(1, agentContext, default);

            Assert.False(isSuccess);
        }