CleanCart.Tests.Controllers.ShopCatalogControllerTest.IndexShouldListAllItems C# (CSharp) Метод

IndexShouldListAllItems() приватный Метод

private IndexShouldListAllItems ( ) : void
Результат void
        public void IndexShouldListAllItems()
        {
            var service = new Mock<IShopCatalogService>();
            var catalogItemDtos = new List<CatalogItemDTO>();
            service.Setup(x => x.ListCatalogItems()).Returns(catalogItemDtos);
            var shopCatalogController = new ShopCatalogController(service.Object);

            var viewResult = shopCatalogController.Index();

            var viewModel = viewResult.Model as ShopCatalogViewModel;
            viewModel.CatalogItems.Should().BeEquivalentTo(catalogItemDtos);
        }
    }