public void Success_ValueAboveThresholdClippedChanged() { // Setup const int qualityScore = 51; const int maxThreshold = 50; var item = new Item("Name", 1, qualityScore, QualityStrategy.LinearDecrease, ShelfLifeStrategy.Stable); var algorithm = new QualityNeverAboveThresholdAlgorithm(maxThreshold); // Execution algorithm.Run(item, item); // Assert Assert.AreEqual(50, item.Quality); }
public void Success_QualityLowerThanThresholdNeverChanged() { // Setup const int maxThreshold = 50; var algorithm = new QualityNeverAboveThresholdAlgorithm(maxThreshold); for (var qualityScore = 0; qualityScore <= maxThreshold; qualityScore++) { var item = new Item("Name", 1, qualityScore, QualityStrategy.LinearDecrease, ShelfLifeStrategy.Stable); // Execution algorithm.Run(item, item); // Assert Assert.AreEqual(qualityScore, item.Quality); } }