Example #1
0
        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);
        }
Example #3
0
        public Item UpdateItem(BaseItem backStagePass)
        {
            bool reduced = backStagePass.DecreaseSellIn();

            if (reduced)
            {
                Printer.PrintItem(this.GetType().Name, backStagePass);
            }

            return(backStagePass);
        }
Example #4
0
        public Item UpdateItem(BaseItem theOlderTheBetter)
        {
            bool reduced = theOlderTheBetter.DecreaseSellIn();

            if (reduced)
            {
                Printer.PrintItem(this.GetType().Name, theOlderTheBetter);
            }

            return(theOlderTheBetter);
        }
Example #5
0
        /// <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);
        }