Пример #1
0
 public void CreateGroupRequest(GroupRequest groupRequest)
 {
     var oldgroup = GetGroupRequests().Where(g => g.UserId == groupRequest.UserId && g.GroupId == groupRequest.GroupId);
     if (oldgroup.Count() == 0)
     {
         groupRequestRepository.Add(groupRequest);
         SaveGroupRequest();
     }
 }
Пример #2
0
 public void Group_Join_Request_Reject_Post_Action_Test()
 {
     GroupRequest request = new GroupRequest()
     {
         UserId = "402bd590-fdc7-49ad-9728-40efbfe512ec",
         GroupId = 1
     };
     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.RejectRequest(1, "402bd590-fdc7-49ad-9728-40efbfe512ec") as RedirectToRouteResult;
     Assert.AreEqual("ShowAllRequests", result.RouteValues["action"]);
 }