コード例 #1
0
        public void TestCalculateTax_Medical_Imported()
        {
            ProductFactory productFactory = new MedicalFactory();
            var            name           = "Packet of headache pills";
            var            price          = 9.75m;
            var            qty            = 1;
            bool           isImported     = true;
            Product        meds           = productFactory.CreateProduct(name, price, qty, isImported);
            decimal        expectedTax    = .50m;
            var            actualTax      = meds.CalculateTax(TaxSettings);

            Assert.AreEqual(expectedTax, actualTax);
        }
コード例 #2
0
        public void TestCalculateTax_Medical_NotImported()
        {
            ProductFactory productFactory = new MedicalFactory();
            var            name           = "Crutches";
            var            price          = 150;
            var            qty            = 2;
            bool           isImported     = false;
            Product        meds           = productFactory.CreateProduct(name, price, qty, isImported);
            decimal        expectedTax    = 0m;
            var            actualTax      = meds.CalculateTax(TaxSettings);

            Assert.AreEqual(expectedTax, actualTax);
        }