Example #1
0
        public void ChangeSpecialOffer_returnsBool()
        {
            // Arrange
            Type expected = typeof(bool);
            // Act
            var actual = basketService.ChangeSpecialOffer(null, null);

            // Assert
            Assert.AreEqual(expected, actual.GetType());
        }
Example #2
0
 public Boolean ChangeSpecialOffer(string sku, SpecialOffer specialOffer)
 {
     if (!String.IsNullOrWhiteSpace(sku))
     {
         if (basketservice.ChangeSpecialOffer(sku, specialOffer))
         {
             var product = ProductList.FirstOrDefault(p => p.SKU == sku);
             if (product != null)
             {
                 product.Offer = specialOffer;
                 return(true);
             }
         }
     }
     return(false);
 }