GildedRose-Refactoring-Kata/csharpcore/GildedRose/AbstractItemBuilder.cs
Sarah Ashri d076fc9ba4 Add ItemBuilders hierarchy to enforce building valid items
Also updated unit tests:
- Added unit tests for the new ItemBuilders classes
- Refactored existing tests to use the new builders
2024-03-15 11:46:55 +10:00

13 lines
362 B
C#

namespace GildedRoseKata;
public abstract class AbstractItemBuilder(string name, int sellIn, int quality)
{
protected readonly string Name = name;
protected readonly int SellIn = sellIn;
protected readonly int Quality = quality;
public virtual Item Build()
{
return new() { Name = Name, SellIn = SellIn, Quality = Quality };
}
}