@@ -76,9 +76,11 @@ public void TestAmqpUriParseSucceed()
76
76
{
77
77
/* From the spec */
78
78
ParseSuccess ( "amqp://user:pass@host:10000/vhost" ,
79
- "user" , "pass" , "host" , 10000 , "vhost" ) ;
79
+ "user" , "pass" , "host" , 10000 , "vhost" , false ) ;
80
+ ParseSuccess ( "amqps://user:pass@host:10000/vhost" ,
81
+ "user" , "pass" , "host" , 10000 , "vhost" , true ) ;
80
82
ParseSuccess ( "aMQps://user%61:%61pass@host:10000/v%2fhost" ,
81
- "usera" , "apass" , "host" , 10000 , "v/host" ) ;
83
+ "usera" , "apass" , "host" , 10000 , "v/host" , true ) ;
82
84
ParseSuccess ( "amqp://localhost" , "guest" , "guest" , "localhost" , 5672 , "/" ) ;
83
85
ParseSuccess ( "amqp://:@localhost/" , "" , "" , "localhost" , 5672 , "/" ) ;
84
86
ParseSuccess ( "amqp://user@localhost" ,
@@ -137,12 +139,13 @@ public void TestAmqpUriParseSucceed()
137
139
}
138
140
}
139
141
140
- private static void AssertUriPartEquivalence ( string user , string password , int port , string vhost , ConnectionFactory cf )
142
+ private static void AssertUriPartEquivalence ( ConnectionFactory cf , string user , string password , int port , string vhost , bool tlsEnabled )
141
143
{
142
144
Assert . AreEqual ( user , cf . UserName ) ;
143
145
Assert . AreEqual ( password , cf . Password ) ;
144
146
Assert . AreEqual ( port , cf . Port ) ;
145
147
Assert . AreEqual ( vhost , cf . VirtualHost ) ;
148
+ Assert . AreEqual ( tlsEnabled , cf . Tls . Enabled ) ;
146
149
}
147
150
148
151
private void ParseFailWith < T > ( string uri ) where T : Exception
@@ -151,26 +154,27 @@ private void ParseFailWith<T>(string uri) where T : Exception
151
154
Assert . That ( ( ) => cf . Uri = new Uri ( uri ) , Throws . TypeOf < T > ( ) ) ;
152
155
}
153
156
154
- private void ParseSuccess ( string uri , string user , string password , string host , int port , string vhost )
157
+ private void ParseSuccess ( string uri , string user , string password , string host , int port , string vhost , bool tlsEnabled = false )
155
158
{
156
159
var factory = new ConnectionFactory
157
160
{
158
161
Uri = new Uri ( uri )
159
162
} ;
160
- AssertUriPartEquivalence ( user , password , port , vhost , factory ) ;
163
+ AssertUriPartEquivalence ( factory , user , password , port , vhost , tlsEnabled ) ;
161
164
Assert . AreEqual ( host , factory . HostName ) ;
162
165
}
163
166
164
167
private void ParseSuccess ( string uri , string user , string password ,
165
- string [ ] hosts , int port , string vhost )
168
+ string [ ] hosts , int port , string vhost , bool tlsEnabled = false )
166
169
{
167
170
var factory = new ConnectionFactory
168
171
{
169
172
Uri = new Uri ( uri )
170
173
} ;
171
- AssertUriPartEquivalence ( user , password , port , vhost , factory ) ;
174
+ AssertUriPartEquivalence ( factory , user , password , port , vhost , tlsEnabled ) ;
172
175
Assert . IsTrue ( Array . IndexOf ( hosts , factory . HostName ) != - 1 ) ;
173
176
}
177
+
174
178
public static bool IsRunningOnMono ( )
175
179
{
176
180
#if CORECLR
0 commit comments