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); }
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); } }