public void JoinSessionShouldTransitionToSessionJoinedState()
        {
            // Arrange
            MultiplayerSessionReservation successfulReservation = new MultiplayerSessionReservation(
                TestConstants.TEST_CORRELATION_ID,
                TestConstants.TEST_PLAYER_ID,
                TestConstants.TEST_RESERVATION_KEY);

            IClient serverClient = Substitute.For <IClient>();

            serverClient.IsConnected.Returns(true);

            IMultiplayerSessionConnectionContext connectionContext = Substitute.For <IMultiplayerSessionConnectionContext>();

            connectionContext.Reservation.Returns(successfulReservation);
            connectionContext.Client.Returns(serverClient);

            SessionReserved connection = new SessionReserved();

            // Act
            connection.JoinSession(connectionContext);

            // Assert
            connectionContext.Received().UpdateConnectionState(Arg.Any <SessionJoined>());
        }
        public void JoinSessionShouldSendPlayerJoiningMultiplayerSessionPacket()
        {
            // Arrange
            MultiplayerSessionReservation successfulReservation = new MultiplayerSessionReservation(
                TestConstants.TEST_CORRELATION_ID,
                TestConstants.TEST_PLAYER_ID,
                TestConstants.TEST_RESERVATION_KEY);

            IClient client = Substitute.For <IClient>();

            client.IsConnected.Returns(true);

            IMultiplayerSessionConnectionContext connectionContext = Substitute.For <IMultiplayerSessionConnectionContext>();

            connectionContext.Reservation.Returns(successfulReservation);
            connectionContext.Client.Returns(client);

            SessionReserved connectionState = new SessionReserved();

            // Act
            connectionState.JoinSession(connectionContext);

            // Assert
            client.Received().Send(Arg.Any <PlayerJoiningMultiplayerSession>());
        }