Example #1
0
        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);
        }
Example #2
0
        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);
        }