public void GetAllOrders_Should_Return_A_List() { var db = new ProjectMongoDB(); var list = db.GetAllOrder(); Assert.AreEqual(1, list.Count()); }
public ActionResult Index() { ProjectMongoDB db = new ProjectMongoDB(); var orders = db.GetAllOrder().ToList(); if (Session["IsAdmin"] != null) { orders.ForEach(order => order.Toys = db.GetAllOrderPrice(order) as List <Toy>); } Orders model = new Orders(); model.EntityList = orders; return(View(model)); }