public ActionResult WishListMiniCartDetails() { WishListMiniCartViewModel viewModel = new WishListMiniCartViewModel { ItemCount = _cartService.GetLineItemsTotalQuantity(), WishListPage = _contentLoader.Get <StartPage>(ContentReference.StartPage).WishListPage, CartItems = _cartService.GetCartItems(), Total = _cartService.GetTotal() }; return(PartialView("_WishListMiniCartDetails", viewModel)); }
public void CreateWishListMiniCartViewModel_WhenCartIsNull_ShouldCreateViewModel() { var viewModel = _subject.CreateWishListMiniCartViewModel(null); var expectedViewModel = new WishListMiniCartViewModel { ItemCount = 0, WishListPage = _startPage.WishListPage, CartItems = new CartItemViewModel[0], Total = new Money(0, Currency.USD) }; viewModel.ShouldBeEquivalentTo(expectedViewModel); }
public void CreateWishListMiniCartViewModel_ShouldCreateViewModel() { var viewModel = _subject.CreateWishListMiniCartViewModel(_cart); var expectedViewModel = new WishListMiniCartViewModel { ItemCount = 1, WishListPage = _startPage.WishListPage, CartItems = _cartItems, Total = _totals.SubTotal }; viewModel.ShouldBeEquivalentTo(expectedViewModel); }