Esempio n. 1
0
        public void GetRestauranteByIdFail()
        {
            var controller = new RestauranteController(db);

            var actionResult = controller.GetById(1);
            var result       = actionResult as NotFoundResult;

            Assert.IsNotNull(result);
            Assert.AreEqual(404, result.StatusCode);
        }
Esempio n. 2
0
        public void GetRestauranteById()
        {
            var controller      = new RestauranteController(db);
            var restauranteTest = repo.Where(r => r.Nome == "Demo1").FirstOrDefault();

            var actionResult = controller.GetById(restauranteTest.Id);
            var result       = actionResult as OkObjectResult;

            Assert.IsNotNull(result);
            Assert.AreEqual(200, result.StatusCode);
        }