コード例 #1
0
        public void SubmitPayment_returns_TransactionResult_without_errors_for_valid_order()
        {
            // arrange
            var order = new Order();

            order.Items.Add(new Product {
                Id = "ABC", Name = "Widget 1", Description = "A widget", Price = 1.99m
            });
            order.Items.Add(new Product {
                Id = "DEF", Name = "Widget 2", Description = "Another widget", Price = 3.99m
            });
            order.PaymentInfo = _paymentInfo;

            // act
            var result = _paymentService.SubmitPayment(order);

            // assert
            Assert.IsInstanceOfType(result, typeof(TransactionResult));
            Assert.IsFalse(result.HasErrors);
        }
コード例 #2
0
 public TransactionResult SubmitOrder(Order order)
 {
     return(_paymentGatewayService.SubmitPayment(order));
 }