Пример #1
0
        public int ConjuredQualityDegradesFaster(int sellIn, int quality)
        {
            IQualityStrategy conjuredQualityStrategy = ConjuredQualityStrategy.Instance;
            var inv = new InventoryItem {
                SellIn = sellIn, Quality = quality
            };

            return(conjuredQualityStrategy.UpdateQuality(inv));
        }
Пример #2
0
        public int BackstagePassesCanImproveFaster(int sellIn, int quality)
        {
            IQualityStrategy backstageQualityStrategy = BackstagePassQualityStrategy.Instance;
            var inv = new InventoryItem {
                SellIn = sellIn, Quality = quality
            };

            return(backstageQualityStrategy.UpdateQuality(inv));
        }
Пример #3
0
        public int QualityDegrades(int sellIn, int quality)
        {
            IQualityStrategy degradingQualityStrategy = DegradingQualityStrategy.Instance;
            var inv = new InventoryItem {
                SellIn = sellIn, Quality = quality
            };

            return(degradingQualityStrategy.UpdateQuality(inv));
        }
Пример #4
0
        public int QualityCanImprove(int sellIn, int quality)
        {
            IQualityStrategy improveQualityStrategy = ImprovingQualityStrategy.Instance;
            var inv = new InventoryItem {
                SellIn = sellIn, Quality = quality
            };

            return(improveQualityStrategy.UpdateQuality(inv));
        }
Пример #5
0
        public void QualityReducesNormally()
        {
            IQualityStrategy legendaryStrategy = LegendaryQualityStrategy.Instance;
            var inv = new InventoryItem {
                SellIn = 0, Quality = 5
            };

            Assert.AreEqual(5, legendaryStrategy.UpdateQuality(inv));
        }
Пример #6
0
 public InventoryItem()
 {
     QualityStrategy = LegendaryQualityStrategy.Instance;
 }
 public BackstagePassQualityStrategy(IQualityStrategy strategy)
     : base(strategy)
 {
 }
Пример #8
0
 public ItemUpgrade(Func<Item, bool> match, IItemAging itemAging = null, IQualityStrategy qualityStrategy = null)
 {
     _match = match;
     _qualityStrategy = qualityStrategy ?? new NormalQuality();
     _itemAging = itemAging ?? new NormalAging();
 }
 public ConjuredQualityStrategy(IQualityStrategy strategy)
     : base(strategy)
 {
 }
Пример #10
0
 public DefaultQualityStrategy(IQualityStrategy strategy)
     : base(strategy)
 {
 }
 public QualityStrategyDecorator(IQualityStrategy strategy)
 {
     this.strategy = strategy;
 }
 public ConjuredQualityStrategy(IQualityStrategy strategy)
     : base(strategy)
 {
 }
 public QualityStrategyDecorator(IQualityStrategy strategy)
 {
     this.strategy = strategy;
 }
 public AgedBrieQualityStrategy(IQualityStrategy strategy)
     : base(strategy)
 {
 }
Пример #15
0
 public AgedBrieQualityStrategy(IQualityStrategy strategy)
     : base(strategy)
 {
 }
Пример #16
0
 public DefaultQualityStrategy(IQualityStrategy strategy)
     : base(strategy)
 {
 }
Пример #17
0
 public BackstagePassQualityStrategy(IQualityStrategy strategy)
     : base(strategy)
 {
 }
Пример #18
0
 public ItemUpgrade(Func <Item, bool> match, IItemAging itemAging = null, IQualityStrategy qualityStrategy = null)
 {
     _match           = match;
     _qualityStrategy = qualityStrategy ?? new NormalQuality();
     _itemAging       = itemAging ?? new NormalAging();
 }