Ejemplo n.º 1
0
        public async Task GetPetTypesReturnsAllPetsTypes()
        {
            var repoMock = new Mock <IPetRepository>();
            var logger   = new Mock <ILogger>();

            logger.Setup(x => x.Path).Returns("sample");
            repoMock.Setup(x => x.GetPetTypes()).Returns(new FakeModelRepo().GetPetTypes());
            var controller = new PetController(repoMock.Object, logger.Object);

            var result = await controller.GetPetTypes() as OkObjectResult;

            if (result != null)
            {
                Assert.IsType <List <PetType> >(result.Value);
            }
        }