Commit 284bbe52 authored by Karel Frajtak's avatar Karel Frajtak

Test

parents 23d69f17 cf662a4e
...@@ -6,6 +6,7 @@ ...@@ -6,6 +6,7 @@
import cz.cvut.eshop.shop.Order; import cz.cvut.eshop.shop.Order;
import cz.cvut.eshop.shop.ShoppingCart; import cz.cvut.eshop.shop.ShoppingCart;
import cz.cvut.eshop.shop.StandardItem;
import org.junit.After; import org.junit.After;
import org.junit.AfterClass; import org.junit.AfterClass;
import org.junit.Before; import org.junit.Before;
...@@ -37,4 +38,15 @@ public class OrderTest { ...@@ -37,4 +38,15 @@ public class OrderTest {
// act // act
assertEquals(10, order.getState()); assertEquals(10, order.getState());
} }
@Test
public void itemsPassedCanBeRead() {
// setup
ShoppingCart cart = new ShoppingCart();
cart.addItem(new StandardItem(0, "", 0, "", 0));
Order order = new Order(cart, 0);
// act
// assert
assertEquals(1, order.getItems().size());
}
} }
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment