public void DegradesExtraConjuredRatePastSellIn(int quality) { bool sellInPassed = true; int expectedDegradedQuality = quality - (TheGetDegradedQualityMethod.QUALITY_DEGRADES_BY * TheGetDegradedQualityMethod.SELLIN_PASSED_MULTIPLIER * CONJURED_ADDITIONAL_DEGRADES_MULTIPLIER); int degradedQuality = InventoryManagementRules.GetConjuredQuality(quality, sellInPassed); Assert.Equal(expectedDegradedQuality, degradedQuality); }
public void DegradesAtConjuredRateDuringSellIn(int quality) { bool sellInPassed = false; int exectedDegradedQuality = quality - (TheGetDegradedQualityMethod.QUALITY_DEGRADES_BY * CONJURED_ADDITIONAL_DEGRADES_MULTIPLIER); int degradedQuality = InventoryManagementRules.GetConjuredQuality(quality, sellInPassed); Assert.Equal(exectedDegradedQuality, degradedQuality); }
// int.Min rolls over to positive and causes quality to degrade at lower rate (but we aren't manually reducing sellIn in this method, again 6 million years, that's fine) public void QualityDecreasesIncreasedRate(int sellIn, int quality) { var conjuredItem = new FinestGood(CONJURED_ITEM_NAME, sellIn, quality); bool sellInPassed = InventoryManagementRules.HasSellInPassed(sellIn); int expectedQuality = InventoryManagementRules.GetConjuredQuality(quality, sellInPassed); new ConjuredItemUpdaterRuleset().ApplyUpdates(conjuredItem); Assert.Equal(expectedQuality, conjuredItem.Quality); }