public void TestIfAdministrationControllerAllReservationsActionReturnsIActionResult() { var mockHotelService = new Mock <IHotelService>(); var mockUserService = new Mock <IUserService>(); var mockStaysService = new Mock <IStaysService>(); var store = new Mock <IUserStore <ApplicationUser> >(); var mgr = new Mock <UserManager <ApplicationUser> >(store.Object, null, null, null, null, null, null, null, null); mgr.Object.UserValidators.Add(new UserValidator <ApplicationUser>()); mgr.Object.PasswordValidators.Add(new PasswordValidator <ApplicationUser>()); var applicationDbcontext = new ApplicationDbContext(CreateNewContextOptions()); var testController = new AdministrationController(applicationDbcontext, mockUserService.Object, mockStaysService.Object, mgr.Object, mockHotelService.Object); var allReservationsResult = testController.AllReservations(); Assert.IsAssignableFrom <PartialViewResult>(allReservationsResult); }