mirror of
https://github.com/emilybache/GildedRose-Refactoring-Kata.git
synced 2026-02-15 22:41:30 +00:00
27 lines
754 B
C#
27 lines
754 B
C#
using NUnit.Framework;
|
|
using System.Collections.Generic;
|
|
|
|
namespace csharp
|
|
{
|
|
[TestFixture]
|
|
public class ConjuredGildedRoseTest
|
|
{
|
|
[Test]
|
|
public void Quality()
|
|
{
|
|
IList<Item> Items = new List<Item> { new Item { Name = "Conjured Mana Cake", SellIn = 1, Quality = 8 } };
|
|
GildedRose app = new GildedRose(Items);
|
|
|
|
// "Conjured" items degrade in Quality twice as fast as normal items.
|
|
// So,
|
|
// SellIn >= 0 => degrade = -2
|
|
// SellIn < 0 => degrade = -4
|
|
app.UpdateQuality();
|
|
Assert.AreEqual(6, Items[0].Quality);
|
|
|
|
app.UpdateQuality();
|
|
Assert.AreEqual(2, Items[0].Quality);
|
|
}
|
|
}
|
|
}
|