mirror of
https://github.com/emilybache/GildedRose-Refactoring-Kata.git
synced 2026-02-19 16:31:30 +00:00
Additional tests for GildedRose.
This commit is contained in:
parent
2bb99fc97a
commit
69818f29a8
@ -7,12 +7,22 @@ namespace GildedRoseTests
|
|||||||
{
|
{
|
||||||
public class GildedRoseTest
|
public class GildedRoseTest
|
||||||
{
|
{
|
||||||
|
|
||||||
const string AgedBrie = "Aged Brie";
|
const string AgedBrie = "Aged Brie";
|
||||||
const string BackstagePass = "Backstage passes to a TAFKAL80ETC concert";
|
const string BackstagePass = "Backstage passes to a TAFKAL80ETC concert";
|
||||||
const string Sulfuras = "Sulfuras, Hand of Ragnaros";
|
const string Sulfuras = "Sulfuras, Hand of Ragnaros";
|
||||||
const string Vest = "+5 Dexterity Vest";
|
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]
|
[Fact]
|
||||||
public void when_sellin_is_negative_for_all_items_except_aged_brie_quality_is_decreased_twice_as_fast()
|
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);
|
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]
|
[Fact]
|
||||||
public void when_sellin_is_decreased_for_aged_brie_quality_is_increased_by_one()
|
public void when_sellin_is_decreased_for_aged_brie_quality_is_increased_by_one()
|
||||||
{
|
{
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user