mirror of
https://github.com/emilybache/GildedRose-Refactoring-Kata.git
synced 2026-02-15 22:41:30 +00:00
Item class SellIn is mutable
This commit is contained in:
parent
29586834b4
commit
676f6facda
@ -11,4 +11,8 @@ public class BaseItem {
|
||||
public int getSellIn() {
|
||||
return item.sellIn;
|
||||
}
|
||||
|
||||
public void setSellIn(int sellIn) {
|
||||
this.item.sellIn = sellIn;
|
||||
}
|
||||
}
|
||||
|
||||
@ -12,4 +12,11 @@ class BaseItemTest {
|
||||
BaseItem baseItem = new BaseItem(new Item("foo", 10, 20));
|
||||
assertEquals(10, baseItem.getSellIn());
|
||||
}
|
||||
|
||||
@Test
|
||||
void itMutatesTheSellInValueOfTheItem() {
|
||||
BaseItem baseItem = new BaseItem(new Item("foo", 10, 20));
|
||||
baseItem.setSellIn(9);
|
||||
assertEquals(9, baseItem.getSellIn());
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user