Ejemplo n.º 1
0
        public UpdateConjuredItemsTests()
        {
            _decreaseQuality = Substitute.For <IDecreaseQuality>();
            _decreaseSellIn  = Substitute.For <IDecreaseSellIn>();

            _sut = new UpdateConjuredItems(_decreaseQuality, _decreaseSellIn);
        }
Ejemplo n.º 2
0
        private void RunProgram(List <Item> items)
        {
            var updateAgedBrie       = new UpdateAgedBrie(new IncreaseQuality(), new DecreaseSellIn());
            var updateBackStageItems = new UpdateBackStageItems(new IncreaseQuality(), new DecreaseSellIn());
            var updateOrdinaryItems  = new UpdateOrdinaryItem(new DecreaseQuality(), new DecreaseSellIn());
            var updateConjuredItems  = new UpdateConjuredItems(new DecreaseQuality(), new DecreaseSellIn());

            var updateInventory = new UpdateInventory(updateBackStageItems, updateAgedBrie, updateConjuredItems,
                                                      updateOrdinaryItems);

            var app = new Program(items, updateInventory);

            app.UpdateQuality();
        }
Ejemplo n.º 3
0
        static void Main(string[] args)
        {
            System.Console.WriteLine("OMGHAI!");
            var updateAgedBrie       = new UpdateAgedBrie(new IncreaseQuality(), new DecreaseSellIn());
            var updateBackStageItems = new UpdateBackStageItems(new IncreaseQuality(), new DecreaseSellIn());
            var updateOrdinaryItems  = new UpdateOrdinaryItem(new DecreaseQuality(), new DecreaseSellIn());
            var updateConjuredItems  = new UpdateConjuredItems(new DecreaseQuality(), new DecreaseSellIn());

            var updateInventory = new UpdateInventory(updateBackStageItems, updateAgedBrie, updateConjuredItems,
                                                      updateOrdinaryItems);


            var app = new Program(new List <Item>
            {
                new Item {
                    Name = "+5 Dexterity Vest", SellIn = 10, Quality = 20
                },
                new Item {
                    Name = "Aged Brie", SellIn = 2, Quality = 0
                },
                new Item {
                    Name = "Elixir of the Mongoose", SellIn = 5, Quality = 7
                },
                new Item {
                    Name = "Sulfuras, Hand of Ragnaros", SellIn = 0, Quality = 80
                },
                new Item
                {
                    Name    = "Backstage passes to a TAFKAL80ETC concert",
                    SellIn  = 15,
                    Quality = 20
                },
                new Item {
                    Name = "Conjured Mana Cake", SellIn = 3, Quality = 6
                }
            }, updateInventory);

            app.UpdateQuality();

            System.Console.ReadKey();
        }