public void getById() { Cart c = new Cart(); Product p = new Product() { id = 1, name = "prueba1" }; c.add(p); Assert.AreEqual(c.getById(1).id , p.id); }
public void add() { Cart c = new Cart(); Product p = new Product() { id = 1 , name = "prueba1" }; Assert.IsTrue(c.add(p)); Assert.IsNotNull(c.getById(p.id)); }
public void add_empty() { Cart c = new Cart(); Product p = new Product(); bool result = c.add(p); Assert.IsFalse(result); }
public void get() { Cart c = new Cart(); Product p = new Product() { id = 1, name = "prueba1" }; c.add(p); Product q = c.get().First(); Assert.AreEqual(q.id, p.id); }
public void remove_complete() { Cart c = new Cart(); Product p = new Product() { id = 1, name = "prueba1" }; c.add(p); Assert.IsTrue(c.remove(p.id)); Assert.IsNull(c.getById(p.id)); }
public void remove_1() { Cart c = new Cart(); Product p = new Product() { id = 1, name = "prueba1" }; c.add(p); c.add(p); Assert.IsTrue(c.remove(p.id)); Assert.AreEqual(c.getById(p.id).quantity , 1); }