Example #1
0
        public ActionResult Cart()
        {
            ViewBag.Message = "Your cart page.";

            CartItemsController controller = new CartItemsController();

            //63839
            return(View(CartFactory.Create(0)));
        }
Example #2
0
        public static Cart Create(int cartId)
        {
            _ItemsController    itemsController     = new _ItemsController();
            CartItemsController cartItemsController = new CartItemsController();

            User user = new UserBuilder()
                        .SetFirstName("August")
                        .SetLastName("Alexandersson")
                        .SetAge(21)
                        .SetTitle("Dr")
                        .SetBillingAddress("SandlyckevÀgen 28")
                        .SetCountry("Sweden")
                        .SetCity("BorÄs")
                        .SetEmail("*****@*****.**")
                        .SetId(0)
                        .Build();

            List <PickedItem> items = itemsController
                                      .GetItemsFromCartItems(
                cartItemsController.GetListOfItems(cartId)
                );

            return(new Cart(cartId, items, user));
        }