mirror of
https://github.com/emilybache/GildedRose-Refactoring-Kata.git
synced 2026-02-16 06:51:27 +00:00
- refactor the UpdateQuality method by : * removing all static item names * strongly typing the different items * moving specific business logic inside the business object
32 lines
625 B
C#
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;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|