Exemple #1
0
        public IActionResult AllCats()
        {
            ShelfViewModel viewModel = new ShelfViewModel {
                Cats = catService.GetAllCats()
            };

            return(View("Cats", viewModel));
        }
Exemple #2
0
        public IActionResult Index()
        {
            AllCatsViewModel allCats = new AllCatsViewModel()
            {
                Cats = _catService.GetAllCats()
            };

            return(View(allCats));
        }
Exemple #3
0
        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());
        }
Exemple #4
0
        public async Task <IActionResult> All()
        {
            var catsModel = await catService.GetAllCats();

            return(View(catsModel));
        }