Exemplo n.º 1
0
        public void Accept_Group_Join_Request_Post_Action()
        {
            GroupInvitation invitation = new GroupInvitation()
            {
                ToUserId = "402bd590-fdc7-49ad-9728-40efbfe512ec",
                GroupId = 1
            };
            groupInvitationRepository.Setup(x => x.Get(It.IsAny<Expression<Func<GroupInvitation, bool>>>())).Returns(invitation);

            GroupRequest request = new GroupRequest()
            {
                GroupId = 1,
                UserId = "402bd590-fdc7-49ad-9728-40efbfe512ec"
            };
            groupRequestRepository.Setup(x => x.Get(It.IsAny<Expression<Func<GroupRequest, bool>>>())).Returns(request);
            GroupController controller = new GroupController(groupService, groupUserService, userService, metricService, focusService, groupgoalService, groupInvitationService, securityTokenService, groupUpdateService, groupCommentService, goalStatusService, groupRequestService, followUserService, groupCommentUserService, groupUpdateSupportService, groupUpdateUserService);
            var result = controller.AcceptRequest(1, "402bd590-fdc7-49ad-9728-40efbfe512ec") as RedirectToRouteResult;
            Assert.AreEqual("ShowAllRequests", result.RouteValues["action"]);
        }