示例#1
0
        public void FinalPriceTest()
        {
            AbstractItem item = new Item(Enums.Category.BOOK, true, 18.99m);
            item = new TaxedItem(item);
            decimal result = 20.89m;
            Assert.AreEqual(result, item.FinalPrice);

            AbstractItem anotherItem = new Item(Enums.Category.BOOK, true, 0m);
            anotherItem = new TaxedItem(anotherItem);
            decimal anotherResult = 0.00m;
            Assert.AreEqual(anotherResult, anotherItem.FinalPrice);
        }
示例#2
0
        public void SaletaxTest()
        {
            AbstractItem item = new Item(Enums.Category.BOOK, true, 18.99m);
            item = new TaxedItem(item);

            decimal result = 1.90m;
            Assert.AreEqual(result, item.SaleTax);

            AbstractItem anotherItem = new Item(Enums.Category.BOOK, true, 0m);
            anotherItem = new TaxedItem(anotherItem);
            decimal anotherResult = 0.00m;
            Assert.AreEqual(anotherResult, anotherItem.SaleTax);
        }
示例#3
0
        public void MutipleTaxesFinalPriceTest()
        {
            AbstractItem item = new Item(Enums.Category.BOOK, true, 47.50m);
            item = new ImportedItem(item);
            item = new TaxedItem(item);
            decimal result = 54.65m;
            Assert.AreEqual(result, item.FinalPrice);

            AbstractItem anotherItem = new Item(Enums.Category.BOOK, true, 0m);
            anotherItem = new ImportedItem(anotherItem);
            decimal anotherResult = 0.00m;
            Assert.AreEqual(anotherResult, anotherItem.FinalPrice);
        }
示例#4
0
        public void MultipleSaletaxTest()
        {
            AbstractItem item = new Item(Enums.Category.BOOK, true, 47.50m);
            item = new ImportedItem(item);
            item = new TaxedItem(item);
           
            decimal result = 7.15m;
            Assert.AreEqual(result, item.SaleTax);

            AbstractItem nexeItem = new Item(Enums.Category.BOOK, true, 47.50m);
            nexeItem = new TaxedItem(nexeItem);
            nexeItem = new ImportedItem(nexeItem);

            decimal nextResult = 7.15m;
            Assert.AreEqual(nextResult, nexeItem.SaleTax);

            AbstractItem anotherItem = new Item(Enums.Category.BOOK, true, 0m);
            anotherItem = new TaxedItem(anotherItem);
            anotherItem = new ImportedItem(anotherItem);

            decimal anotherResult = 0.00m;
            Assert.AreEqual(anotherResult, anotherItem.SaleTax);
        }