public void Initialize_HasNoOrderNumber_OrderNumberIsGenerated() { CreditCard creditCard = new CreditCard(); Mock <IPayExPayment> paymentMock = new Mock <IPayExPayment>(); paymentMock.SetupAllProperties(); _orderNumberGeneratorMock.Setup(x => x.Generate(It.IsAny <Cart>())).Returns("Ordernumber"); creditCard.Payment = paymentMock.Object; creditCard.OrderGroupId = 1000; _orderNumberGenerator.Initialize(creditCard, null, null, null); Assert.IsNotNullOrEmpty(creditCard.Payment.OrderNumber); }
public override PaymentInitializeResult Initialize() { IPaymentInitializer initializer = new GenerateOrderNumber( new InitializePayment( new RedirectUser(), _paymentManager, _parameterReader, _cartActions, _additionalValuesFormatter), _orderNumberGenerator); return(initializer.Initialize(this, null, null, null)); }
public override PaymentInitializeResult Initialize() { IPaymentInitializer initializer = new GenerateOrderNumber( new GetConsumerLegalAddress( new InitializePayment( new PurchaseInvoiceSale(_paymentManager, _paymentActions), _paymentManager, _parameterReader, _cartActions, _additionalValuesFormatter), _verificationManager, _paymentActions), _orderNumberGenerator); return(initializer.Initialize(this, null, null, null)); }