public void ReturnViewResultInstance_WhenCalled() { // Arrange var visitsServiceMock = new Mock <IVisitsService>(); var municipalitiesServiceMock = new Mock <IMunicipalitiesService>(); var usersServiceMock = new Mock <IUserService>(); var pageServiceMock = new Mock <IPageService <Visit> >(); municipalitiesServiceMock.Setup(m => m.GetAll()).Returns(new List <Municipality>()); var controller = new VisitsController(visitsServiceMock.Object, municipalitiesServiceMock.Object, usersServiceMock.Object, pageServiceMock.Object); // Act var result = controller.Index(); // Assert Assert.IsNotNull(result); Assert.IsInstanceOfType(result, typeof(ViewResult)); }
//[TestMethod] //[TestCategory("Index")] public void ShouldCheckResultFromVisitsControllerIndexIsNotNull() { var value = _visitsController.Index() as ViewResult; Assert.IsNotNull(value); }