gilded-rose-dotnet-core/test/ConjuredTest.cs

33 lines
844 B
C#
Raw Normal View History

2020-08-31 22:13:03 +00:00
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};
}
}