gilded-rose-dotnet-core/test/ConjuredTest.cs
2020-09-01 00:13:25 +02:00

33 lines
844 B
C#

using System.Collections.Generic;
using Xunit;
namespace csharpcore
{
// "Conjured" items degrade in Quality twice as fast as normal items
public class ConjuredTest
{
private readonly List<Item> _items;
private GildedRose _rose;
public ConjuredTest()
{
_items = new List<Item>();
_rose =new GildedRose(_items);
}
//[Fact]
public void ShouldDecreaseInQuality()
{
var item = GenerateItem(3, 2);
_items.Add(item);
_rose.UpdateQuality();
Assert.Equal(1, item.Quality);
Assert.Equal(1, item.SellIn);
}
public Item GenerateItem(int quality, int sellInDays)
=> new Item {Name = "Conjured Mana Cake", Quality = quality, SellIn = sellInDays};
}
}