GildedRose-Refactoring-Kata/csharpcore-Verify.xunit/GildedRose/AgingItem.cs
Nicolas 4df10d3b34 - add unit tests to legacy code for each business rule
- refactor the UpdateQuality method by :
* removing all static item names
* strongly typing the different items
* moving specific business logic inside the business object
2022-11-15 15:57:49 +01:00

22 lines
377 B
C#

namespace GildedRoseKata
{
public class AgingItem : Item
{
public virtual void SetAgingItemQuality()
{
if (Quality < 50)
{
Quality++;
SellIn--;
if (SellIn < 0 && Quality < 50)
{
Quality++;
}
}
}
}
}