public void SetPaymentInfoOnTransactionModelWithPaymentIsSuccessful() { // ARRANGE const string SETTLEMENT_ACTION_CODE_PAYMENT = "PAYMENT"; TransactionModel mockModel = new TransactionModel(); var bookingPaymentMock = new Model.Booking.Payment(); Model.Order.Order orderMock = new Order() { IntegrationType = IntegrationTypeEnum.WhiteLabel }; List<SettlementPaymentDto> settlementPaymentsMock = new List<SettlementPaymentDto>() { new SettlementPaymentDto { ActionCode = SETTLEMENT_ACTION_CODE_PAYMENT } }; bool forceProcess = false; const string last4Digits = "0123"; bookingPaymentMock.CardLast4Digits = last4Digits; SettlementManager settlementManager = new SettlementManager(); // Act settlementManager.SetPaymentInfoOnTransactionModel(mockModel, bookingPaymentMock, settlementPaymentsMock, orderMock, forceProcess); // Assert Assert.AreEqual(last4Digits, mockModel.MaskedCardNumber, "Should have been set if settlement payment is present"); }
public void SetPaymentInfoOnTransactionModelWithNoPaymentNotMyWebDoesNotThrowException() { // ARRANGE TransactionModel mockModel = new TransactionModel(); var bookingPaymentMock = new Model.Booking.Payment(); List<SettlementPaymentDto> settlementPaymentsMock = new List<SettlementPaymentDto>(); Model.Order.Order orderMock = new Order() { IntegrationType = IntegrationTypeEnum.RequestResponse }; bookingPaymentMock.CardLast4Digits = "0123"; bool forceProcess = false; SettlementManager settlementManager = new SettlementManager(); // Act settlementManager.SetPaymentInfoOnTransactionModel(mockModel, bookingPaymentMock, settlementPaymentsMock, orderMock, forceProcess); // Assert Assert.IsNull(mockModel.MaskedCardNumber, "Should not have been set if settlement payment not present and not myweb or toprooms"); }
public void SetPaymentInfoOnTransactionModelWithNoPaymentAndForceProccessIsSuccessful() { // ARRANGE TransactionModel mockModel = new TransactionModel(); var bookingPaymentMock = new Model.Booking.Payment(); List<SettlementPaymentDto> settlementPaymentsMock = new List<SettlementPaymentDto>(); Model.Order.Order orderMock = new Order(); bool forceProcess = true; bookingPaymentMock.CardLast4Digits = "0123"; SettlementManager settlementManager = new SettlementManager(); // Act settlementManager.SetPaymentInfoOnTransactionModel(mockModel, bookingPaymentMock, settlementPaymentsMock, orderMock, forceProcess); // Assert Assert.IsNull(mockModel.MaskedCardNumber, "Should not have been set if settlement payment not present"); }
public void SetPaymentInfoOnTransactionModelWithNoPaymentThrowsException() { // ARRANGE TransactionModel mockModel = new TransactionModel(); var bookingPaymentMock = new Model.Booking.Payment(); List<SettlementPaymentDto> settlementPaymentsMock = new List<SettlementPaymentDto>(); Model.Order.Order orderMock = new Order() { IntegrationType = IntegrationTypeEnum.Myweb }; bool forceProcess = false; SettlementManager settlementManager = new SettlementManager(); // Act settlementManager.SetPaymentInfoOnTransactionModel(mockModel, bookingPaymentMock, settlementPaymentsMock, orderMock, forceProcess); // Assert // done in expected exception }