Example #1
0
        public void TestPhysicalPaymentProcess()
        {
            PhysicalPaymentProcess = new PhysicalProductPaymentProcess();
            Assert.AreNotEqual(null, PhysicalPaymentProcess);

            string result = PhysicalPaymentProcess.PaymentProcess(order, paymentAmount);

            Assert.AreEqual("success", result);
        }
Example #2
0
        public void TestBookPaymentProcess()
        {
            bookPaymentProcess = new BookPaymentProcess();
            Assert.AreNotEqual(null, bookPaymentProcess);

            string result = bookPaymentProcess.PaymentProcess(order, paymentAmount);

            Assert.AreEqual("success", result);
        }
Example #3
0
        public void NewMemberShipPaymentTest()
        {
            memberPaymentProcess = new MemberPaymentProcess();
            Assert.AreNotEqual(null, memberPaymentProcess);

            string result = memberPaymentProcess.PaymentProcess(order, paymentAmount);

            Assert.IsNotEmpty(result);
            Assert.AreEqual("success", result);
        }
Example #4
0
        public string DoProcess(int type, string cname, string pname, double amount)
        {
            Order order = new Order();

            order.CreateDependencies(type, cname, pname);
            ProductType productType = order.ProductObj.Type;
            int         value       = (int)productType;

            // get payment prcess object.
            _processPayment = GetPaymentProcess(value);
            if (_processPayment != null)
            {
                // execute the process
                _processPayment.PaymentProcess(order, amount);
                return("processed");
            }
            else
            {
                return("Payment Not processed. Please select right product type");
            }
        }