Browse Source

Added: Item class + Basic InStock Test

feature-pr/shop
Maxim Volkov 3 years ago
parent
commit
866ff0de7d
  1. 15
      projjpn/src/main/java/de/hs_fulda/ciip/projjpn/Item.java
  2. 16
      projjpn/src/test/java/de/hs_fulda/ciip/projjpn/ItemTest.java

15
projjpn/src/main/java/de/hs_fulda/ciip/projjpn/Item.java

@ -0,0 +1,15 @@
package de.hs_fulda.ciip.projjpn;
public class Item {
// price
// customerReview
// productTitle
// description
// tags
int availability = 0;
public boolean inStock() {
return availability > 0;
}
}

16
projjpn/src/test/java/de/hs_fulda/ciip/projjpn/ItemTest.java

@ -0,0 +1,16 @@
package de.hs_fulda.ciip.projjpn;
import junit.framework.TestCase;
public class ItemTest extends TestCase {
public void test_ItemNotInStock() {
// Given
Item item = new Item();
// When
boolean notInStock = item.inStock();
// Then
assertFalse(notInStock);
}
}
Loading…
Cancel
Save