public async Task Index_CanLoadFromContext() { var controller = new AlugueresController(_context); var result = await controller.Index(); var viewResult = Assert.IsType <ViewResult>(result); Assert.IsAssignableFrom <IEnumerable <Aluguer> >( viewResult.ViewData.Model); }
public async Task Index_ClienteIsIncluded_WhenLoadsFromContext() { var controller = new AlugueresController(_context); var result = await controller.Index(); var viewResult = Assert.IsType <ViewResult>(result); var model = Assert.IsAssignableFrom <IEnumerable <Aluguer> >( viewResult.ViewData.Model); Assert.NotNull(model.FirstOrDefault().Cliente); }