Ejemplo n.º 1
0
        public static Int32 GetQuality(string ItemName, Int32 Quality, Int32 Days)
        {
            var IncQuality  = new IncreaseQuality();
            var DecQualtity = new ReduceQuality();

            switch (ItemName)
            {
            case "Aged Brie":
                IncQuality.Days   = 1;
                IncQuality.Factor = 1;
                return(IncQuality.GetQuality(Quality));

            case "Backstage passes":
                IncQuality.Days   = 1;
                IncQuality.Factor = (Days < 10 && Days > 5 ? 2 : Days <= 5 ? 3 : 1);
                return(IncQuality.GetQuality(Quality));

            case "Sulfuras":
                return(Quality);

            case "Normal item":
                DecQualtity.Days   = 1;
                DecQualtity.Factor = 1;
                return(DecQualtity.GetQuality(Quality));

            case "Conjured":
                DecQualtity.Days   = 1;
                DecQualtity.Factor = 2;
                return(DecQualtity.GetQuality(Quality));

            default:
                return(-99);
            }
        }
Ejemplo n.º 2
0
        public void TestIncrease()
        {
            var newItem         = new GRItems("Aged Brie", 1, 1);
            var IncreaseQuality = new IncreaseQuality();

            IncreaseQuality.Days   = 1;
            IncreaseQuality.Factor = 1;
            Assert.AreNotEqual(IncreaseQuality.GetQuality(newItem.QualityValue), newItem.QualityValue);
        }
Ejemplo n.º 3
0
 public IncreaseQualityTests()
 {
     _sut = new IncreaseQuality();
 }