public void ContentInsurancesController_Index_Test() { //Arrange var policyService = new Mock <IInsurancePolicyService>(); policyService.Setup(c => c.GetContentInsurances()) .Returns(new List <ContentInsurance>()); policyService.Setup(c => c.GetCategories()) .Returns(new List <Category>()); ContentInsurancesController controller = new ContentInsurancesController(policyService.Object); //Act ViewResult result = controller.Index() as ViewResult; //Assert result.As <ViewResult>().Model.Should().BeOfType <CommonViewModel>(); Assert.NotNull(result.Model); }