public void UT_When_HandleGetPendingGames_Then_Success()
        {
            this.sessionServiceMock
                .Setup(s => s.GetPendings(It.Is<string>(x => x == this.requestPlayer)))
                .Returns(this.sessions)
                .Verifiable();

            var getPendingGamesClientMessage = new GetPendingGamesClientMessage
            {
                UserName = this.requestPlayer
            };
            var clientContract = new ClientContract
            {
                Type = GamifyClientMessageType.GetPendingGames,
                Sender = this.requestPlayer,
                SerializedClientMessage = this.serializer.Serialize(getPendingGamesClientMessage)
            };

            var gameSelectionPluginComponent = this.GetGameSelectionPluginComponent();
            var canHandle = gameSelectionPluginComponent.CanHandleClientMessage(clientContract);

            gameSelectionPluginComponent.HandleClientMessage(clientContract);

            this.sessionServiceMock.VerifyAll();
            this.notificationServiceMock.Verify(s => s.Send(It.Is<int>(t => t == GamifyServerMessageType.PendingGamesList),
                It.Is<object>(o => (((PendingGamesListServerMessage)o).PendingGamesCount == 2)
                    && ((PendingGamesListServerMessage)o).PlayerName == this.requestPlayer),
                It.Is<string>(x => x == this.requestPlayer)));

            Assert.IsTrue(canHandle);
        }
 public void RequestPendingGames(GetPendingGamesClientMessage getPendingGamesClientMessage)
 {
     this.pendingGamesService.Send(getPendingGamesClientMessage);
 }