public void SearchTest() { PartialViewResult rv = (PartialViewResult)_controller.Index(); Assert.IsInstanceOfType(rv.Model, typeof(IBasePagedListVM <TopBasePoco, BaseSearcher>)); string rv2 = _controller.Search(rv.Model as SchoolListVM); Assert.IsTrue(rv2.Contains("\"Code\":200")); }
public async Task IndexReturnsPageWithSchoolViewModel() { // Act and Assert var controller = await _controller.Index(1); controller.Should() .BeViewResult().WithDefaultViewName(); var res = controller.Should() .BeOfType <ViewResult>().Subject; var test = res.Model.Should() .BeAssignableTo <SchoolViewModel>().Subject; }
public void SearchTest() { PartialViewResult rv = (PartialViewResult)_controller.Index(); Assert.IsInstanceOfType(rv.Model, typeof(IBasePagedListVM <TopBasePoco, BaseSearcher>)); }