Esempio n. 1
0
 public void NoDiscountTest()
 {
     var a = new Product("A", 2.00);
     Assert.AreEqual(a.GetName(), "A");
     Assert.AreEqual(a.GetPrice(), 2.00);
     Assert.AreEqual(a.GetDiscounts(), new Discount[]{});
 }
Esempio n. 2
0
        public void ConstructorTest()
        {
            var discount = new VolumeDiscount(7.00, 4);
            var discounts = new Discount[] { discount };

            var a = new Product("A", 2.00, discounts);
            Assert.AreEqual(a.GetName(), "A");
            Assert.AreEqual(a.GetPrice(), 2.00);
            Assert.AreEqual(a.GetDiscounts(), discounts);
        }