public void SearchEngineCreateGetTest() { using (SearchEngineController searchEngineController = new SearchEngineController()) { ActionResult actionResult = searchEngineController.Create(); ViewResult viewResult = actionResult as ViewResult; Assert.IsNotNull(viewResult); } }
public void SearchEngineCreatePostTest() { using (SearchEngineController searchEngineController = new SearchEngineController()) { SearchEngine google = new SearchEngine() { Name = "Google", Domain = "https://www.google.com", URL = "https://www.google.com/search?q=" }; Task <ActionResult> task = searchEngineController.Create(google); task.Wait(); ActionResult actionResult = task.Result; RedirectToRouteResult redirectToRouteResult = actionResult as RedirectToRouteResult; Assert.IsNotNull(redirectToRouteResult); Assert.IsTrue(google.Id > 0); } }