public void PlayerCanRemoveAFriendRequest()
        {
            authHelper.loginToAccount("userOne");

            SendFriendRequestRequest request = new SendFriendRequestRequest()
            {
                FriendId = authHelper.getAccountId("userTwo")
            };

            SendFriendRequestResponse response = client.SendFriendRequest(request);

            Assert.AreEqual(response.Status.IsSuccess, true);

            authHelper.loginToAccount("userTwo");

            DenyFriendRequestRequest friendRequest = new DenyFriendRequestRequest()
            {
                FriendId = authHelper.getAccountId("userOne"),
            };

            DenyFriendRequestResponse acceptResponse = client.DenyFriendRequest(friendRequest);

            Assert.AreEqual(acceptResponse.Status.IsSuccess, true);

            ViewFriendRequestsResponse friendResponse = client.ViewFriendRequests(new ViewFriendRequestsRequest());

            Assert.AreEqual(friendResponse.Status.IsSuccess, true);
            Assert.AreEqual(0, friendResponse.IncomingFriends.Count);
        }
        public override async Task <DenyFriendRequestResponse> DenyFriendRequest(DenyFriendRequestRequest request, ServerCallContext context)
        {
            DbUserModel dbUserModel = context.UserState["user"] as DbUserModel;

            if (dbUserModel == null)
            {
                return new DenyFriendRequestResponse()
                       {
                           Status = ResponseFactory.createResponse(ResponseType.UNAUTHORIZED)
                       }
            }
            ;

            DbUserModel friend = await DbUserModel.GetUserFromGuid(request.FriendId);

            if (friend == null)
            {
                return new DenyFriendRequestResponse()
                       {
                           Status = ResponseFactory.createResponse(ResponseType.PLAYER_DOES_NOT_EXIST)
                       }
            }
            ;

            if (!await dbUserModel.HasFriendRequestFrom(friend))
            {
                return new DenyFriendRequestResponse()
                       {
                           Status = ResponseFactory.createResponse(ResponseType.FRIEND_REQUEST_DOES_NOT_EXIST)
                       }
            }
            ;

            return(new DenyFriendRequestResponse()
            {
                Status = await dbUserModel.RemoveFriendRequestFrom(friend),
            });
        }