Exemplo n.º 1
0
        static void Main(string[] args)
        {
            var Items = new List <GRItems>
            {
                new GRItems("Aged Brie", 1, 1),
                new GRItems("Backstage passes", -1, 2),
                new GRItems("Backstage passes", 9, 2),
                new GRItems("Sulfuras", 2, 2),
                new GRItems("Normal item", -1, 55),
                new GRItems("Normal item", 2, 2),
                new GRItems("INVALID ITEM", 2, 2),
                new GRItems("Conjured", 2, 2),
                new GRItems("Conjured", -1, 5),
            };


            var SellingValue = new DecreaseSelling();

            SellingValue.Days   = 1;
            SellingValue.Factor = 1;
            foreach (var item in Items)
            {
                var SValue = SellingValue.GetSellingValue(item.SellingValue);
                var Qvalue = GetQuality(item.ItemName, item.QualityValue, item.SellingValue);
                if (Qvalue == -99)
                {
                    Console.WriteLine("NO SUCH ITEM");
                }
                else
                {
                    Console.WriteLine(item.ItemName + ' ' + (item.ItemName == "Sulfuras" ? item.SellingValue : SValue) + ' ' + Qvalue);
                }
            }
        }
Exemplo n.º 2
0
        public void TestSelling()
        {
            var newItem         = new GRItems("Aged Brie", 1, 1);
            var DecreaseSelling = new DecreaseSelling();

            DecreaseSelling.Days   = 1;
            DecreaseSelling.Factor = 1;
            Assert.IsTrue(DecreaseSelling.GetSellingValue(newItem.SellingValue) < newItem.QualityValue);
        }