Commit db9afc0a authored by Karel Frajtak's avatar Karel Frajtak

Get items test

parent a3e3b5b3
...@@ -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;
...@@ -28,4 +29,15 @@ public class OrderTest { ...@@ -28,4 +29,15 @@ public class OrderTest {
order.create(); order.create();
// assert // assert
} }
@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