public void GetAllReturnsAListOfMarkdowns()
        {
            IRepository <ISpecial> specialsRepository = new SpecialsRepository();

            var specialsList = specialsRepository.GetAll();

            Assert.NotNull(specialsList);
        }
        public void SaveAddsRestrictionSpecialToList()
        {
            IRepository <ISpecial> specialsRepository = new SpecialsRepository();

            specialsRepository.Save(restrictionSpecialLesser);

            var priceList = specialsRepository.GetAll();

            Assert.AreEqual(priceList.Count, 1);
            Assert.AreEqual(priceList[0].Type, SpecialType.Restriction);
        }
        public void SaveAddsLimitSpecialToList()
        {
            IRepository <ISpecial> specialsRepository = new SpecialsRepository();

            specialsRepository.Save(limitSpecialNoLimit);

            var priceList = specialsRepository.GetAll();

            Assert.AreEqual(priceList.Count, 1);
            Assert.AreEqual(priceList[0].Type, SpecialType.Limit);
        }
        public void UpdateWithExistingSpecialUpdatesRightSpecial()
        {
            IRepository <ISpecial> specialsRepository = new SpecialsRepository();

            specialsRepository.Save(priceSpecial);
            bool updated        = specialsRepository.Update(updatedPriceSpecial);
            var  specialsList   = specialsRepository.GetAll();
            var  updatedSpecial = (PriceSpecial)specialsList[0];

            Assert.IsTrue(updated);
            Assert.AreEqual(updatedSpecial.ProductName, "Can of soup");
            Assert.AreEqual(updatedSpecial.Price, 6);
        }