public void DecreaseSellIn() { var baseItem = new BaseItem("Base name", 0, 50); baseItem.DecreaseSellIn(); Assert.Equal(baseItem.SellIn, -1); }
public Item UpdateItem(BaseItem legendaryItem) { legendaryItem.DecreaseSellIn(); Printer.PrintItem(this.GetType().Name, legendaryItem); return(legendaryItem); }
public Item UpdateItem(BaseItem backStagePass) { bool reduced = backStagePass.DecreaseSellIn(); if (reduced) { Printer.PrintItem(this.GetType().Name, backStagePass); } return(backStagePass); }
public Item UpdateItem(BaseItem theOlderTheBetter) { bool reduced = theOlderTheBetter.DecreaseSellIn(); if (reduced) { Printer.PrintItem(this.GetType().Name, theOlderTheBetter); } return(theOlderTheBetter); }
/// <summary> /// An item /// </summary> /// <param name="item"></param> /// <returns></returns> public Item UpdateItem(BaseItem item) { if (item.IsSellInNonPositiveInteger()) { item.DecreaseQuality(2); } else { item.DecreaseQuality(1); } item.DecreaseSellIn(); Printer.PrintItem(this.GetType().Name, item); return(item); }