mirror of
https://github.com/emilybache/GildedRose-Refactoring-Kata.git
synced 2026-02-15 14:31:28 +00:00
Also updated unit tests: - Added unit tests for the new ItemBuilders classes - Refactored existing tests to use the new builders
17 lines
415 B
C#
17 lines
415 B
C#
using System;
|
|
|
|
namespace GildedRoseKata;
|
|
|
|
public class LegendaryItemBuilder(string name, int sellIn)
|
|
: AbstractItemBuilder(name, sellIn, ItemQuality.LegendaryItemQuality)
|
|
{
|
|
public override Item Build()
|
|
{
|
|
if (!ItemType.IsLegendaryItem(Name))
|
|
{
|
|
throw new ArgumentException("Only Legendary items can be built using this builder");
|
|
}
|
|
|
|
return base.Build();
|
|
}
|
|
} |