@@ -127,4 +127,82 @@ public void ConnectionInfo_should_allow_null_security()
127127
128128 Assert . Null ( info . Security ) ;
129129 }
130+
131+ [ Fact ( Timeout = 5000 ) ]
132+ public void SecurityInfo_should_default_negotiated_cipher_suite_to_null ( )
133+ {
134+ var info = new SecurityInfo ( SslProtocols . Tls13 , SslApplicationProtocol . Http2 ) ;
135+
136+ Assert . Null ( info . NegotiatedCipherSuite ) ;
137+ }
138+
139+ [ Fact ( Timeout = 5000 ) ]
140+ public void SecurityInfo_should_default_hostname_to_null ( )
141+ {
142+ var info = new SecurityInfo ( SslProtocols . Tls13 , SslApplicationProtocol . Http2 ) ;
143+
144+ Assert . Null ( info . HostName ) ;
145+ }
146+
147+ [ Fact ( Timeout = 5000 ) ]
148+ public void SecurityInfo_should_store_negotiated_cipher_suite ( )
149+ {
150+ var info = new SecurityInfo (
151+ SslProtocols . Tls13 ,
152+ SslApplicationProtocol . Http2 ,
153+ TlsCipherSuite . TLS_AES_256_GCM_SHA384 ) ;
154+
155+ Assert . Equal ( TlsCipherSuite . TLS_AES_256_GCM_SHA384 , info . NegotiatedCipherSuite ) ;
156+ }
157+
158+ [ Fact ( Timeout = 5000 ) ]
159+ public void SecurityInfo_should_store_hostname ( )
160+ {
161+ var info = new SecurityInfo (
162+ SslProtocols . Tls13 ,
163+ SslApplicationProtocol . Http2 ,
164+ HostName : "example.com" ) ;
165+
166+ Assert . Equal ( "example.com" , info . HostName ) ;
167+ }
168+
169+ [ Fact ( Timeout = 5000 ) ]
170+ public void SecurityInfo_should_store_all_fields ( )
171+ {
172+ var info = new SecurityInfo (
173+ SslProtocols . Tls13 ,
174+ SslApplicationProtocol . Http2 ,
175+ TlsCipherSuite . TLS_AES_128_GCM_SHA256 ,
176+ "host.example.com" ) ;
177+
178+ Assert . Equal ( SslProtocols . Tls13 , info . Protocol ) ;
179+ Assert . Equal ( SslApplicationProtocol . Http2 , info . ApplicationProtocol ) ;
180+ Assert . Equal ( TlsCipherSuite . TLS_AES_128_GCM_SHA256 , info . NegotiatedCipherSuite ) ;
181+ Assert . Equal ( "host.example.com" , info . HostName ) ;
182+ }
183+
184+ [ Fact ( Timeout = 5000 ) ]
185+ public void TransportTlsState_should_implement_ITransportInbound ( )
186+ {
187+ ITransportInbound msg = new TransportTlsState ( SslStream : null , AllowDelayedNegotiation : false ) ;
188+
189+ Assert . IsType < TransportTlsState > ( msg ) ;
190+ }
191+
192+ [ Fact ( Timeout = 5000 ) ]
193+ public void TransportTlsState_should_carry_allow_delayed_flag ( )
194+ {
195+ var msg = new TransportTlsState ( SslStream : null , AllowDelayedNegotiation : true ) ;
196+
197+ Assert . True ( msg . AllowDelayedNegotiation ) ;
198+ }
199+
200+ [ Fact ( Timeout = 5000 ) ]
201+ public void TransportTlsState_should_allow_null_ssl_stream ( )
202+ {
203+ var msg = new TransportTlsState ( SslStream : null , AllowDelayedNegotiation : false ) ;
204+
205+ Assert . Null ( msg . SslStream ) ;
206+ Assert . False ( msg . AllowDelayedNegotiation ) ;
207+ }
130208}
0 commit comments