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); }
public void AcceptingPlayerCanViewFriendAfterAcceptingRequest() { 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"); AcceptFriendRequestRequest friendRequest = new AcceptFriendRequestRequest() { FriendId = authHelper.getAccountId("userOne"), }; AcceptFriendRequestResponse acceptResponse = client.AcceptFriendRequest(friendRequest); Assert.AreEqual(acceptResponse.Status.IsSuccess, true); ViewFriendsResponse friendResponse = client.ViewFriends(new ViewFriendsRequest()); Assert.AreEqual(friendResponse.Status.IsSuccess, true); Assert.AreEqual(1, friendResponse.Friends.Count); Assert.IsTrue(friendResponse.Friends.Any((friend) => friend.Id == authHelper.getAccountId("userOne"))); }