mirror of
https://github.com/emilybache/GildedRose-Refactoring-Kata.git
synced 2026-02-06 02:02:31 +00:00
increasing test coverage
This commit is contained in:
parent
b8bd42e9da
commit
0238cf2fe2
@ -9,7 +9,7 @@ import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||
public class InventoryRuleEngineTest {
|
||||
|
||||
@Test
|
||||
void shouldProcessAgedBrieRule() {
|
||||
void shouldApplyAgedBrieRule() {
|
||||
//given
|
||||
ItemAdapter itemAdapter = new ItemAdapter(ItemType.AGEG_BRIE, new Item("Aged Brie", 3, 0));
|
||||
|
||||
@ -20,4 +20,46 @@ public class InventoryRuleEngineTest {
|
||||
assertEquals(2, itemAdapter.getItem().sellIn);
|
||||
assertEquals(1, itemAdapter.getItem().quality);
|
||||
}
|
||||
|
||||
@Test
|
||||
void shouldApplySulfurasRule() {
|
||||
//given
|
||||
ItemAdapter itemAdapter = new ItemAdapter(ItemType.SULFURAS,
|
||||
new Item("Sulfuras, Hand of Ragnaros", 3, 80));
|
||||
|
||||
//when
|
||||
InventoryRuleEngine.applyUpdateRule(itemAdapter);
|
||||
|
||||
//then
|
||||
assertEquals(3, itemAdapter.getItem().sellIn);
|
||||
assertEquals(80, itemAdapter.getItem().quality);
|
||||
}
|
||||
|
||||
@Test
|
||||
void shouldApplyBackstagePassesRule() {
|
||||
//given
|
||||
ItemAdapter itemAdapter = new ItemAdapter(ItemType.BACKSTAGE_PASSES,
|
||||
new Item("Backstage passes to a TAFKAL80ETC concert", 3, 10));
|
||||
|
||||
//when
|
||||
InventoryRuleEngine.applyUpdateRule(itemAdapter);
|
||||
|
||||
//then
|
||||
assertEquals(2, itemAdapter.getItem().sellIn);
|
||||
assertEquals(13, itemAdapter.getItem().quality);
|
||||
}
|
||||
|
||||
@Test
|
||||
void shouldApplyStandardItemRule() {
|
||||
//given
|
||||
ItemAdapter itemAdapter = new ItemAdapter(ItemType.STANDARD,
|
||||
new Item("Elixir of the Mongoose", 5, 7));
|
||||
|
||||
//when
|
||||
InventoryRuleEngine.applyUpdateRule(itemAdapter);
|
||||
|
||||
//then
|
||||
assertEquals(4, itemAdapter.getItem().sellIn);
|
||||
assertEquals(6, itemAdapter.getItem().quality);
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user