public void isAddedSellCount() { Product prod = new Product("Banana", PType.Clothes, 1, 21, 2); prod.Buy(); Assert.AreEqual(1, prod.SellCounter); }
public void isChangedPstatus() { Product prod = new Product("Banana", PType.Clothes, 1, 21, 2); prod.Buy(); Assert.AreEqual(PStatus.LowQuantity, prod.InStock); }
public void isResetTopSeller() { Product prod = new Product("Banana", PType.Clothes, 1, 21, 2); prod.Buy(); prod.ResetSells(); Assert.AreEqual(0, prod.SellCounter); }
public void isTopSellerRestarted() { Backend.Product prod1 = new Backend.Product("Banana", PType.Electronics, 1, 21, 2); Backend.Product prod2 = new Backend.Product("avocado", PType.Food, 1, 21, 5); prod1.Buy(); prod1.Buy(); prod2.Buy(); List <Backend.Product> Allprods = new List <Backend.Product>(); Allprods.Add(prod1); Allprods.Add(prod2); TopSeller(Allprods, DateTime.Today.Month); Assert.IsTrue(prod1.IsTopSeller); Assert.IsFalse(prod2.IsTopSeller); TopSeller(Allprods, 1); Assert.IsFalse(prod1.IsTopSeller); Assert.IsFalse(prod2.IsTopSeller); }