Exemplo n.º 1
0
        public void SubcategoryControllerDeleteActionGetActionRendersRightView()
        {
            //arrange
            const string viewName = "Delete";
            var          itemName = Constants.SubcategoriesInDatabase[0];

            //act
            ViewResult result = _subcategoryController.Delete(itemName.Id) as ViewResult;

            //assert
            Assert.IsNotNull(result);
            Assert.AreEqual(viewName, result.ViewName);
        }
Exemplo n.º 2
0
        public async Task TestaDelete(long code)
        {
            var response = await _controller.Delete(code);

            if (code == 1234)
            {
                Assert.IsType <ActionResult <SubcategoryPresenter> >(response);
            }
            else
            {
                Assert.IsType <NotFoundResult>(response.Result);
            }
        }