示例#1
0
        public void OnPostTrafficDensity_IfValidModel_ReturnPage()
        {
            var    pageModel  = new SearchListModel();
            string testString = "test";
            var    result     = pageModel.OnPostTrafficDensity(testString);

            Assert.IsType <PageResult>(result);
        }
示例#2
0
        public void OnPostTrafficDensity_IfInvalidModel_ReturnBadRequest()
        {
            var pageModel = new SearchListModel();

            pageModel.ModelState.AddModelError("Error", "Bad request: OnPostSearchList method failed in SearchList.cshtml.cs.");
            string testString = "test";
            var    result     = pageModel.OnPostTrafficDensity(testString);

            Assert.IsType <BadRequestResult>(result);
        }