Updated NormalItemUpdateService test: sellIn is decreased test case

This commit is contained in:
Daniel F 2023-07-11 21:54:38 +01:00
parent 807125a909
commit a90385b7e5

View File

@ -50,3 +50,14 @@ func TestNormalItemUpdateService_QualityNotLowerThan0(t *testing.T) {
assert.Equal(t, 0, item.Model.Quality)
})
}
// sellIn date must decrease
func TestNormalItemUpdateService_SellInIsDecreased(t *testing.T) {
runTestCase(t, func(
normalItemUpdateService NormalItemUpdateService,
) {
item := models.NewItem(&models.ItemModel{"Random normal item", -4, 0})
normalItemUpdateService.UpdateQuality(item)
assert.Equal(t, -5, item.Model.SellIn)
})
}