public void InfrastructureController_GetWarningMessages() { var userService = new Mock <IUserService>(); var adwService = new Mock <IAdwService>(); var controller = new TestPagedGridController(userService.Object, adwService.Object); var result = controller.GetWarningMessages() as ViewResult; Assert.IsNotNull(result); Assert.IsTrue(((IEnumerable <string>)result.Model).Count() == 1); Assert.IsTrue(((IEnumerable <string>)result.Model).Contains(TestPagedGridController.WarningMessage)); }