public void QualityIsNeverAbove50() { _sellingItem.Quality = 53; var s = InventoryFactory.Get(_sellingItem); Assert.AreEqual(50, s.Quality); }
public void QualityIsNeverBelowZero() { _sellingItem.Quality = 0; var s = InventoryFactory.Get(_sellingItem); Assert.AreEqual(0, s.Quality); }
public void SellingDaysIs1_Then_QualityIs0() { _sellingItem.Quality = 0; _sellingItem.SellingDays = 1; var s = InventoryFactory.Get(_sellingItem); Assert.AreEqual(0, s.Quality); }
public void QualityDecreasesByTwo() { _sellingItem.SellingDays = 5; _sellingItem.Quality = 5; var s = InventoryFactory.Get(_sellingItem); Assert.AreEqual(3, s.Quality); }
public void QualityDegradesTwiceAsFastWhenSellingDaysHasPassed() { _sellingItem.SellingDays = -1; _sellingItem.Quality = 5; var s = InventoryFactory.Get(_sellingItem); Assert.AreEqual(3, s.Quality); }
public void SellingDaysIs5_Then_QualityIncreasesByThree() { _sellingItem.Quality = 20; _sellingItem.SellingDays = 5; var s = InventoryFactory.Get(_sellingItem); Assert.AreEqual(23, s.Quality); }
public void SellingDaysIs10_Then_QualityIncreasesByTwo() { _sellingItem.Quality = 20; _sellingItem.SellingDays = 10; var s = InventoryFactory.Get(_sellingItem); Assert.AreEqual(22, s.Quality); }
public void SellingDaysIsGreaterThan10_Then_QualityIncreasesByOne() { _sellingItem.Quality = 15; _sellingItem.SellingDays = 15; var s = InventoryFactory.Get(_sellingItem); Assert.AreEqual(16, s.Quality); }
static void Main(string[] args) { var si = new List <SellingItem>() { new SellingItem() { Name = "Aged Brie", Quality = 1, SellingDays = 1 }, new SellingItem() { Name = "Backstage passes", Quality = 2, SellingDays = -1 }, new SellingItem() { Name = "Backstage passes", Quality = 2, SellingDays = 9 }, new SellingItem() { Name = "Sulfuras", Quality = 2, SellingDays = 2 }, new SellingItem() { Name = "Normal Item", Quality = 55, SellingDays = -1 }, new SellingItem() { Name = "Normal Item", Quality = 2, SellingDays = 2 }, new SellingItem() { Name = "INVALID ITEM", Quality = 2, SellingDays = 2 }, new SellingItem() { Name = "Conjured", Quality = 2, SellingDays = 2 }, new SellingItem() { Name = "Conjured", Quality = 5, SellingDays = -1 }, }; si.ForEach(x => { var i = InventoryFactory.Get(x); if (i is Invalid) { Console.WriteLine($"{i.Name}"); } else { Console.WriteLine($"{i.Name} {i.SellingDays} {i.Quality}"); } }); }
public void QualityDoesNotDecrease() { var s = InventoryFactory.Get(_sellingItem); Assert.AreEqual(1, s.Quality); }
public void DaysDoNotDecrease() { var s = InventoryFactory.Get(_sellingItem); Assert.AreEqual(1, s.SellingDays); }
public void NameIsInvalidItem() { var s = InventoryFactory.Get(_sellingItem); Assert.AreEqual(s.Name, "NO SUCH ITEM"); }
public void DoesNotThrow() { Assert.DoesNotThrow(() => { InventoryFactory.Get(_sellingItem); }); }
public void SellingDaysDecreasesByOne() { var s = InventoryFactory.Get(_sellingItem); Assert.AreEqual(0, s.SellingDays); }
public void QualityDecreasesByOne() { var s = InventoryFactory.Get(_sellingItem); Assert.AreEqual(0, s.Quality); }