コード例 #1
0
        public void BlockingAFriendRemovesThemAsAFriend()
        {
            client.SendFriendRequest(new SendFriendRequestRequest()
            {
                FriendId = authHelper.getAccountId("userTwo")
            });

            authHelper.loginToAccount("userTwo");
            client.AcceptFriendRequest(new AcceptFriendRequestRequest()
            {
                FriendId = authHelper.getAccountId("userOne"),
            });

            // Ensure players are friends
            ViewFriendsResponse friends = client.ViewFriends(new ViewFriendsRequest());

            Assert.AreEqual(friends.Status.IsSuccess, true);
            Assert.AreEqual(1, friends.Friends.Count);


            BlockPlayerResponse blockResponse = client.BlockPlayer(new BlockPlayerRequest()
            {
                UserIdToBlock = authHelper.getAccountId("userOne"),
            });

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

            // Ensure players are not friends
            ViewFriendsResponse friendsAfterBlock = client.ViewFriends(new ViewFriendsRequest());

            Assert.AreEqual(friendsAfterBlock.Status.IsSuccess, true);
            Assert.AreEqual(0, friendsAfterBlock.Friends.Count);
        }
コード例 #2
0
        public void PlayerCanSendFriendRequestToOtherPlayer()
        {
            SendFriendRequestRequest request = new SendFriendRequestRequest()
            {
                FriendId = authHelper.getAccountId("userTwo")
            };

            SendFriendRequestResponse response = client.SendFriendRequest(request);

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