示例#1
0
 public void SearchEngineCreateGetTest()
 {
     using (SearchEngineController searchEngineController = new SearchEngineController())
     {
         ActionResult actionResult = searchEngineController.Create();
         ViewResult   viewResult   = actionResult as ViewResult;
         Assert.IsNotNull(viewResult);
     }
 }
示例#2
0
        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);
            }
        }