Ejemplo n.º 1
0
        public void PlayerCanViewTheirOwnMessageAfterSendingInAGroupChat()
        {
            CreateMessageGroupRequest request = new CreateMessageGroupRequest()
            {
                RoomId = gameId,
            };

            request.UserIdsInGroup.Add(authHelper.getAccountId(playerTwoInGame));
            request.UserIdsInGroup.Add(authHelper.getAccountId(playerOneInGame));

            CreateMessageGroupResponse groupResponse = client.CreateMessageGroup(request);

            Assert.AreEqual(groupResponse.Status.IsSuccess, true);
            Assert.IsTrue(groupResponse.GroupId != null);
            var groupId = groupResponse.GroupId;

            SendMessageResponse response = client.SendMessage(new SendMessageRequest()
            {
                GroupId = groupId,
                Message = "Hello!",
                RoomId  = gameId,
            });

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

            GetGroupMessagesResponse messageResponse = client.GetGroupMessages(new GetGroupMessagesRequest()
            {
                GroupId    = groupId,
                RoomId     = gameId,
                Pagination = 1,
            });

            Assert.AreEqual(messageResponse.Status.IsSuccess, true);
            Assert.AreEqual(messageResponse.Group.Messages.Count, 1);
            Assert.AreEqual(messageResponse.Group.Messages[0].SenderId, authHelper.getAccountId(playerOneInGame));
        }