Exemplo n.º 1
0
        public void GetTotalPriceOfBasket_returnPriceAsString()
        {
            List <Dishes> tempdishlist = new List <Dishes>();

            tempdishlist.Add(item); tempdishlist.Add(item);
            var return200string = controller.GetTotalPriceOfBasket(tempdishlist);

            Assert.AreEqual("200", return200string);
            item.specialprice = 50;
            tempdishlist.Clear();
            tempdishlist.Add(item); tempdishlist.Add(item);
            var return100string = controller.GetTotalPriceOfBasket(tempdishlist);

            Assert.AreEqual("100", return100string);
            tempdishlist.Clear();
            item.price = 0; item.specialprice = null;
            tempdishlist.Add(item);
            var returnStringError = controller.GetTotalPriceOfBasket(tempdishlist);

            Assert.AreEqual("something isn't quite right, ERROR: price isnt set", returnStringError);
        }