public void It_should_never_update_SelIn(ItemType itemType, string name) { var item = new Item { Id = Guid.NewGuid(), Quality = 40, ItemType = itemType, SellIn = 20, Name = name }; GildedRoseQualityUpdater.UpdateQuality(item); GildedRoseStateServiceMock.Verify(x => x.DecreaseSellIn(item.Id), Times.Never); }
public void It_should_never_update_the_quality(ItemType itemType) { var item = new Item { Id = Guid.NewGuid(), Quality = 40, ItemType = itemType, SellIn = 20, Name = string.Empty }; GildedRoseQualityUpdater.UpdateQuality(item); GildedRoseStateServiceMock.Verify(x => x.UpdateQuality(item.Id, It.IsAny <int>()), Times.Never); }
public void It_should_increase_the_quality_when_current_quality_is_below_50(ItemType itemType) { var item = new Item { Id = Guid.NewGuid(), Quality = 49, ItemType = itemType, SellIn = 20, Name = string.Empty }; GildedRoseQualityUpdater.UpdateQuality(item); GildedRoseStateServiceMock.Verify(x => x.UpdateQuality(item.Id, 1), Times.Once); }
public void It_should_update_quality_to_zero_when_sellIn_is_smaller_then_0() { var item = new Item { Id = Guid.NewGuid(), Quality = 20, ItemType = ItemType.BackstagePassesTAFKAL80ETCConcert, SellIn = -1, Name = ItemNames.BackstagePassesTAFKAL80ETCConcert }; GildedRoseQualityUpdater.UpdateQuality(item); GildedRoseStateServiceMock.Verify(x => x.UpdateQualityToZero(item.Id), Times.Once); }
public void It_should_decrease_quality_of_conjured_items_correctly(int quality, int qualityDecrease) { var item = new Item { Id = Guid.NewGuid(), Quality = quality, ItemType = ItemType.ConjuredManaCace, SellIn = 20, Name = string.Empty }; GildedRoseQualityUpdater.UpdateQuality(item); GildedRoseStateServiceMock.Verify(x => x.UpdateQuality(item.Id, -1), Times.Exactly(qualityDecrease)); }
public void It_should_update_quality_of_backstagepasses_Correctly(int quality, int sellIn, int qualityAdition) { var item = new Item { Id = Guid.NewGuid(), Quality = quality, ItemType = ItemType.BackstagePassesTAFKAL80ETCConcert, SellIn = sellIn, Name = string.Empty }; GildedRoseQualityUpdater.UpdateQuality(item); GildedRoseStateServiceMock.Verify(x => x.UpdateQuality(item.Id, 1), Times.Exactly(qualityAdition)); }