public void ChallengeParametersArePassedToClient()
        {
            MockSessionAuthenticationFactory mockSessionAuthenticationFactory =
                new MockSessionAuthenticationFactory();

            WampPendingClientDetails authenticatorFactoryParameters = null;

            mockSessionAuthenticationFactory.SetGetSessionAuthenticator
                ((clientDetails, transportAuthenticator) =>
            {
                authenticatorFactoryParameters = clientDetails;
                MockSessionAuthenticator mockSessionAuthenticator = new MockSessionAuthenticator();
                mockSessionAuthenticator.SetAuthenticationMethod("ticket");
                mockSessionAuthenticator.SetChallengeDetails
                    (new MyChallenge {
                    President = "Obama"
                });

                return(mockSessionAuthenticator);
            });

            WampAuthenticationPlayground playground =
                new WampAuthenticationPlayground(mockSessionAuthenticationFactory);

            playground.Host.Open();

            string           clientAuthMethod       = null;
            ChallengeDetails clientChallengeDetails = null;

            Mock <IWampClient <JToken> > clientMock = new Mock <IWampClient <JToken> >();

            clientMock.Setup(x => x.Challenge(It.IsAny <string>(), It.IsAny <ChallengeDetails>()))
            .Callback((string authMethod, ChallengeDetails details) =>
            {
                clientAuthMethod       = authMethod;
                clientChallengeDetails = details;
            });

            IWampServerProxy serverProxy =
                playground.CreateRawConnection(clientMock.Object);

            serverProxy.Hello("realm1", new HelloDetailsHack()
            {
                AuthenticationId      = "joe",
                AuthenticationMethods = new string[] { "wampcra", "ticket" }
            });

            MyChallenge deserializedChallengeDetails =
                clientChallengeDetails.OriginalValue.Deserialize <MyChallenge>();

            Assert.That(deserializedChallengeDetails.President, Is.EqualTo("Obama"));
            Assert.That(clientAuthMethod, Is.EqualTo("ticket"));
        }