public async void TestCartGetDataWithRandomToken()
        {
            var result = await controller.Cart() as ViewResult;

            Assert.NotNull(result);

            var list = result.Model as List <ModelCart>;

            Assert.Equal(0, list.Count);
        }
예제 #2
0
        public async Task Cart()
        {
            // Arrange
            var mockDish   = new Mock <IDishService>();
            var mockMeal   = new Mock <IMealService>();
            var cart       = new Mock <Domain.Cart>();
            var controller = new CartController(cart.Object, mockMeal.Object, mockDish.Object);

            // Act
            var result = await controller.Cart();

            // Assert
            Assert.IsType <ViewResult>(result);
        }