mirror of
https://github.com/emilybache/GildedRose-Refactoring-Kata.git
synced 2026-02-18 07:51:29 +00:00
Additional tests for GildedRose.
This commit is contained in:
parent
2bb99fc97a
commit
69818f29a8
@ -7,12 +7,22 @@ namespace GildedRoseTests
|
||||
{
|
||||
public class GildedRoseTest
|
||||
{
|
||||
|
||||
const string AgedBrie = "Aged Brie";
|
||||
const string BackstagePass = "Backstage passes to a TAFKAL80ETC concert";
|
||||
const string Sulfuras = "Sulfuras, Hand of Ragnaros";
|
||||
const string Vest = "+5 Dexterity Vest";
|
||||
|
||||
[Fact]
|
||||
public void when_updatequality_is_called_sellin_and_quality_are_decreased()
|
||||
{
|
||||
IList<Item> Items = new List<Item> { new Item { Name = Vest, SellIn = 2, Quality = 10 } };
|
||||
GildedRose app = new GildedRose(Items);
|
||||
app.UpdateQuality();
|
||||
var sut = Items[0];
|
||||
sut.SellIn.Should().Equal(1);
|
||||
sut.Quality.Should().Equal(9);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void when_sellin_is_negative_for_all_items_except_aged_brie_quality_is_decreased_twice_as_fast()
|
||||
{
|
||||
@ -33,6 +43,16 @@ namespace GildedRoseTests
|
||||
sut.Quality.Should().Equal(19);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void when_sellin_is_changed_quality_is_decreased_but_never_negative()
|
||||
{
|
||||
IList<Item> Items = new List<Item> { new Item { Name = Vest, SellIn = 10, Quality = 0 } };
|
||||
GildedRose app = new GildedRose(Items);
|
||||
app.UpdateQuality();
|
||||
var sut = Items[0];
|
||||
sut.Quality.Should().Equal(0);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void when_sellin_is_decreased_for_aged_brie_quality_is_increased_by_one()
|
||||
{
|
||||
|
||||
Loading…
Reference in New Issue
Block a user