Пример #1
0
        public void PaymentNullException()
        {
            //Arrange

            IPaymentBusiness paymentBusiness = new PaymentBusiness(null);

            //Act
            string output = paymentBusiness.ProcessOrder();


            //Assert
        }
Пример #2
0
        public void PaymentLessthanZeroException()
        {
            //Arrange

            IPaymentBusiness paymentBusiness = new PaymentBusiness(invalid);

            //Act
            string output = paymentBusiness.ProcessOrder();


            //Assert
        }
Пример #3
0
        public void MembershipProductPositive()
        {
            //Arrange

            IPaymentBusiness paymentBusiness = new PaymentBusiness(membership);

            //Act
            string output = paymentBusiness.ProcessOrder();


            //Assert
            Assert.IsTrue(output.Contains(Constants.membership));
            Assert.IsTrue(output.Contains(Constants.emailSent));
            Assert.IsFalse(output.Contains(Constants.duplicateSlip));
            Assert.IsFalse(output.Contains(Constants.firstAid));
            Assert.IsFalse(output.Contains(Constants.upgradeMembership));
            Assert.IsFalse(output.Contains(Constants.physicalProduct));
        }
Пример #4
0
        static void Main(string[] args)
        {
            Payments physical = new Payments {
                ProductAmount = 200, eProduct = EProduct.PhysicalProduct
            };
            Payments book = new Payments {
                ProductAmount = 100, eProduct = EProduct.Book
            };
            Payments member = new Payments {
                ProductAmount = 300, eProduct = EProduct.Membership
            };
            Payments upgrade = new Payments {
                ProductAmount = 200, eProduct = EProduct.UpgradeMembership
            };
            Payments video = new Payments {
                ProductAmount = 200, eProduct = EProduct.Video
            };

            IPaymentBusiness paymentBusiness = new PaymentBusiness(video);
            string           output          = paymentBusiness.ProcessOrder();

            Console.WriteLine(output);
        }