public IActionResult AllCats() { ShelfViewModel viewModel = new ShelfViewModel { Cats = catService.GetAllCats() }; return(View("Cats", viewModel)); }
public IActionResult Index() { AllCatsViewModel allCats = new AllCatsViewModel() { Cats = _catService.GetAllCats() }; return(View(allCats)); }
public void GetAllCats_ShouldReturnAllCats() { // Arrange var listMock = CatMocks.GetCatList(); var expected = listMock.Select(x => Mapper.CatDtoFromDataModel(x, Constants.CatService.ADOPTION_TRESHOLD_DAYS, dateProviderMock.Object)); repositoryMock.Setup(x => x.GetAllCats()).Returns(listMock); // Act var result = catService.GetAllCats(); // Assert CollectionAssert.AreEqual(expected.Select(x => x.Id).ToList(), result.Select(x => x.Id).ToList()); }
public async Task <IActionResult> All() { var catsModel = await catService.GetAllCats(); return(View(catsModel)); }