GildedRose-Refactoring-Kata/csharp.xUnit/GildedRose/GildedRose.cs
Artur Goloyad 26870381a4 refactor: organize updaters into Interfaces/Factories/Strategies
Pure file move + namespace alignment, no logic changes:
- Interfaces/  IItemUpdater, IItemUpdaterFactory (GildedRoseKata.Interfaces)
- Factories/   ItemUpdaterFactory incl. static Default() (GildedRoseKata.Factories)
- Strategies/  ItemUpdaterBase + the 5 concrete updaters (GildedRoseKata.Strategies)

GildedRose.cs changes only in usings; Item.cs and Program.cs untouched.
Full suite 24/24 green; approval snapshot byte-identical.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-26 11:46:39 +02:00

29 lines
608 B
C#

using System.Collections.Generic;
using GildedRoseKata.Factories;
using GildedRoseKata.Interfaces;
namespace GildedRoseKata;
public class GildedRose
{
private readonly IList<Item> _items;
private readonly IItemUpdaterFactory _factory;
public GildedRose(IList<Item> items) : this(items, ItemUpdaterFactory.Default())
{
}
public GildedRose(IList<Item> items, IItemUpdaterFactory factory)
{
_items = items;
_factory = factory;
}
public void UpdateQuality()
{
foreach (var item in _items)
_factory.Get(item).Update(item);
}
}