예제 #1
0
        public void InsertPratoFail()
        {
            var prato      = new Prato();
            var controller = new PratoController(db);

            var actionResult = controller.InsertPrato(prato);
            var result       = actionResult as BadRequestObjectResult;

            Assert.IsNotNull(result);
            Assert.AreEqual(400, result.StatusCode);
        }
예제 #2
0
        public void InsertPrato()
        {
            var restaurantesTest = repoR.Where(r => r.Nome == "Demo1").FirstOrDefault();
            var pratoTest        = new Prato {
                RestauranteId = restaurantesTest.Id, Nome = "Prato5", Preco = 50m
            };
            var controller = new PratoController(db);

            var actionResult = controller.InsertPrato(pratoTest);
            var result       = actionResult as OkObjectResult;

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