Exemplo n.º 1
0
        public IActionResult AdoptableCats()
        {
            ShelfViewModel viewModel = new ShelfViewModel {
                Cats = catService.GetAdoptableCats(), OnlyAdoptable = true
            };

            return(View("Cats", viewModel));
        }
Exemplo n.º 2
0
        public void GetAdoptableCats_ShouldReturnOnlyAdoptableCats()
        {
            // Arrange
            repositoryMock.Setup(x => x.GetAllCats()).Returns(CatMocks.GetCatList());

            // Act
            var result = catService.GetAdoptableCats();

            // Assert
            Assert.IsTrue(result.All(x => x.CanBeAdopted));
        }