public void CartItems_ContainsElements() { var cartServiceMock = new Mock <ICartService>(); cartServiceMock.Setup(m => m.GetCartItems()).Returns((new List <CartItem> { new CartItem { Count = 1, Item = new FurnitureItem() }, new CartItem { Count = 3, Item = new FurnitureItem() }, }).AsReadOnly()); var viewModel = new CartViewModel(cartServiceMock.Object); viewModel.InitializeAsync(); Assert.IsNotNull(viewModel.CartItems); Assert.IsTrue(viewModel.CartItems.Any()); }