mirror of
https://github.com/emilybache/GildedRose-Refactoring-Kata.git
synced 2026-02-16 06:51:27 +00:00
Adding unittests for Conjured Item [Failing]
This commit is contained in:
parent
3b309a199f
commit
03d18cbc16
@ -116,6 +116,34 @@ namespace csharpcore
|
|||||||
Assert.Equal(beforeSellIn - 1, items[0].SellIn);
|
Assert.Equal(beforeSellIn - 1, items[0].SellIn);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[Theory]
|
||||||
|
[InlineData(7, 10, 8)]
|
||||||
|
[InlineData(0, 10, 6)]
|
||||||
|
public void UpdateQuality_ConjuredItem_QualityDecreases(int beforeSellIn, int beforeQuality, int afterQuality)
|
||||||
|
{
|
||||||
|
IList<Item> items = new List<Item> { new Item { Name = "Old Conjured Helmet", SellIn = beforeSellIn, Quality = beforeQuality } };
|
||||||
|
GildedRose app = new GildedRose(items);
|
||||||
|
|
||||||
|
app.UpdateQuality();
|
||||||
|
|
||||||
|
Assert.Equal(afterQuality, items[0].Quality);
|
||||||
|
Assert.Equal(beforeSellIn - 1, items[0].SellIn);
|
||||||
|
}
|
||||||
|
|
||||||
|
[Theory]
|
||||||
|
[InlineData(7, 0, 0)]
|
||||||
|
[InlineData(0, 0, 0)]
|
||||||
|
public void UpdateQuality_ConjuredItemMinQuality_QualityCannotGoNegative(int beforeSellIn, int beforeQuality, int afterQuality)
|
||||||
|
{
|
||||||
|
IList<Item> items = new List<Item> { new Item { Name = "Conjured Cake the is a lie !", SellIn = beforeSellIn, Quality = beforeQuality } };
|
||||||
|
GildedRose app = new GildedRose(items);
|
||||||
|
|
||||||
|
app.UpdateQuality();
|
||||||
|
|
||||||
|
Assert.Equal(afterQuality, items[0].Quality);
|
||||||
|
Assert.Equal(beforeSellIn - 1, items[0].SellIn);
|
||||||
|
}
|
||||||
|
|
||||||
[Theory]
|
[Theory]
|
||||||
[InlineData(7, 10, 9)]
|
[InlineData(7, 10, 9)]
|
||||||
[InlineData(0, 10, 8)]
|
[InlineData(0, 10, 8)]
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user