GildedRose-Refactoring-Kata/csharpcore-Verify.xunit/GildedRose/ConcertPass.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

32 lines
625 B
C#

using GildedRoseKata;
namespace GildedRoseKata
{
public class ConcertPass : AgingItem
{
public override void SetAgingItemQuality()
{
if (Quality < 50)
{
Quality++;
if (SellIn < 11 && Quality < 50)
{
Quality++;
}
if (SellIn < 6 && Quality < 50)
{
Quality++;
}
SellIn--;
if (SellIn < 0)
{
Quality = 0;
}
}
}
}
}