public void Delete_Goal_Get_ReturnsView() { GroupGoal fake = new GroupGoal() { GroupGoalId = 1, GoalName = "test", Description = "test", GroupId = 1, StartDate = DateTime.Now, EndDate = DateTime.Now.AddDays(1), GoalStatusId = 1, GroupUserId = 2 }; groupGoalRepository.Setup(x => x.GetById(1)).Returns(fake); GroupController controller = new GroupController(groupService, groupUserService, userService, metricService, focusService, groupgoalService, groupInvitationService, securityTokenService, groupUpdateService, groupCommentService, goalStatusService, groupRequestService, followUserService, groupCommentUserService, groupUpdateSupportService, groupUpdateUserService); ViewResult result = controller.DeleteGoal(1) as ViewResult; Assert.IsNotNull(result, "View Result is null"); Assert.IsInstanceOf(typeof(GroupGoal), result.ViewData.Model, "Wrong View Model"); var group = result.ViewData.Model as GroupGoal; Assert.AreEqual("test", group.Description, "Got wrong Focus Description"); }