public void PaymentFactory_Create_DuplicatePackagingSlip_RoyaltyDep_ForBook()
        {
            //Arrange
            int          book          = PaymentTypeInformation.Book.GetHashCode();
            IPaymentinfo paymentObject = PaymentFactory.GetPaymentObject(book);
            //Act
            bool result = paymentObject.ProcessPaymentInformation();

            //Assert
            Assert.AreEqual(result, true);
        }
        public void PaymentFactory_Should_UpgradeMembership()
        {
            //Arrange
            int          upgrade       = PaymentTypeInformation.MembershipUpgrade.GetHashCode();
            IPaymentinfo paymentObject = PaymentFactory.GetPaymentObject(upgrade);
            //Act
            bool result = paymentObject.ProcessPaymentInformation();

            //Assert
            Assert.AreEqual(result, true);
        }
        public void PaymentFactory_Should_Generate_PackagingSlip_ForPhysicalProduct()
        {
            //Arrange
            int          physicalProduct = PaymentTypeInformation.PhysicalProduct.GetHashCode();
            IPaymentinfo paymentObject   = PaymentFactory.GetPaymentObject(physicalProduct);
            //Act
            bool result = paymentObject.ProcessPaymentInformation();

            //Assert
            Assert.AreEqual(result, true);
        }
Exemple #4
0
        private static void ProcessPaymentOrder(int PaymentTypeInformation)
        {
            IPaymentinfo paymentProcessing = Factory.PaymentFactory.GetPaymentObject(PaymentTypeInformation);

            if (paymentProcessing == null)
            {
                Console.WriteLine("Invalid option!");
            }
            else
            {
                paymentProcessing.ProcessPaymentInformation();
            }
        }
        public void PaymentFactory_Should_Generate_FreeVideoSlip()
        {
            //Arrange
            int          video         = PaymentTypeInformation.Video.GetHashCode();
            IPaymentinfo paymentObject = PaymentFactory.GetPaymentObject(video);

            PaymentFactory.GetPaymentObject(video);
            //Act
            bool result = paymentObject.ProcessPaymentInformation();

            //Assert
            Assert.AreEqual(result, true);
        }