public int ConjuredQualityDegradesFaster(int sellIn, int quality) { IQualityStrategy conjuredQualityStrategy = ConjuredQualityStrategy.Instance; var inv = new InventoryItem { SellIn = sellIn, Quality = quality }; return(conjuredQualityStrategy.UpdateQuality(inv)); }
public int BackstagePassesCanImproveFaster(int sellIn, int quality) { IQualityStrategy backstageQualityStrategy = BackstagePassQualityStrategy.Instance; var inv = new InventoryItem { SellIn = sellIn, Quality = quality }; return(backstageQualityStrategy.UpdateQuality(inv)); }
public int QualityDegrades(int sellIn, int quality) { IQualityStrategy degradingQualityStrategy = DegradingQualityStrategy.Instance; var inv = new InventoryItem { SellIn = sellIn, Quality = quality }; return(degradingQualityStrategy.UpdateQuality(inv)); }
public int QualityCanImprove(int sellIn, int quality) { IQualityStrategy improveQualityStrategy = ImprovingQualityStrategy.Instance; var inv = new InventoryItem { SellIn = sellIn, Quality = quality }; return(improveQualityStrategy.UpdateQuality(inv)); }
public void QualityReducesNormally() { IQualityStrategy legendaryStrategy = LegendaryQualityStrategy.Instance; var inv = new InventoryItem { SellIn = 0, Quality = 5 }; Assert.AreEqual(5, legendaryStrategy.UpdateQuality(inv)); }
public InventoryItem() { QualityStrategy = LegendaryQualityStrategy.Instance; }
public BackstagePassQualityStrategy(IQualityStrategy strategy) : base(strategy) { }
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) { }
public DefaultQualityStrategy(IQualityStrategy strategy) : base(strategy) { }
public QualityStrategyDecorator(IQualityStrategy strategy) { this.strategy = strategy; }
public AgedBrieQualityStrategy(IQualityStrategy strategy) : base(strategy) { }
public ItemUpgrade(Func <Item, bool> match, IItemAging itemAging = null, IQualityStrategy qualityStrategy = null) { _match = match; _qualityStrategy = qualityStrategy ?? new NormalQuality(); _itemAging = itemAging ?? new NormalAging(); }