BuildReconnect() public static method

public static BuildReconnect ( IConnection connection, string transport, string connectionData ) : string
connection IConnection
transport string
connectionData string
return string
Exemplo n.º 1
0
 public void BuildReconnectRetunsValidUrlWithConnectionDataAndCustomQueryString(string qs, string expected)
 {
     Assert.Equal(
         "http://fakeurl/reconnect?clientProtocol=1.42&transport=webPolling&connectionData=CustomConnectionData&connectionToken=My%20Conn%20Token" +
         expected,
         UrlBuilder.BuildReconnect(CreateConnection(qs), "webPolling", "CustomConnectionData"));
 }
Exemplo n.º 2
0
            public void BuildReconnectRetunsValidUrlWithGroupsToken(string groupsToken, string expected)
            {
                var connection = CreateConnection();

                Mock.Get(connection).Setup(c => c.GroupsToken).Returns(groupsToken);

                Assert.Equal(
                    "http://fakeurl/reconnect?clientProtocol=1.42&transport=webPolling&connectionToken=My%20Conn%20Token" +
                    expected,
                    UrlBuilder.BuildReconnect(connection, "webPolling", null));
            }
Exemplo n.º 3
0
        public void BuildReconnectRetunsValidUrlWithMessageId(string messageId, string expected)
        {
            var connection = CreateConnection();

            Mock.Get(connection).Setup(c => c.MessageId).Returns(messageId);

            Assert.True(
                Regex.Match(UrlBuilder.BuildReconnect(connection, "webPolling", null),
                            "^http://fakeurl/reconnect\\?clientProtocol=1.42&transport=webPolling&connectionToken=My%20Conn%20Token" +
                            expected + "&noCache=[a-zA-Z0-9-]{36}$")
                .Success);
        }
Exemplo n.º 4
0
            public void BuildReconnectChecksInputParameters()
            {
                Assert.Equal("connection",
                             Assert.Throws <ArgumentNullException>(
                                 () => UrlBuilder.BuildReconnect(null, "transport", string.Empty)).ParamName);

                Assert.Equal("transport",
                             Assert.Throws <ArgumentNullException>(
                                 () => UrlBuilder.BuildReconnect(Mock.Of <IConnection>(), null, string.Empty)).ParamName);

                Assert.Equal("transport",
                             Assert.Throws <ArgumentNullException>(
                                 () => UrlBuilder.BuildReconnect(Mock.Of <IConnection>(), string.Empty, string.Empty)).ParamName);

                Assert.Equal("transport",
                             Assert.Throws <ArgumentNullException>(
                                 () => UrlBuilder.BuildReconnect(Mock.Of <IConnection>(), " ", string.Empty)).ParamName);
            }
Exemplo n.º 5
0
 public void BuildReconnectRetunsValidUrlWithConnectionData(string connectionData, string expected)
 {
     Assert.Equal(
         "http://fakeurl/reconnect?clientProtocol=1.42&transport=webPolling" + expected + "&connectionToken=My%20Conn%20Token",
         UrlBuilder.BuildReconnect(CreateConnection(), "webPolling", connectionData));
 }