@@ -244,35 +244,43 @@ public void CanInspectCertificateOnClone(string url, string hostname, Type certT
244
244
{
245
245
var scd = BuildSelfCleaningDirectory ( ) ;
246
246
247
- if ( certType == typeof ( CertificateSsh ) && ! GlobalSettings . Version . Features . HasFlag ( BuiltInFeatures . Ssh ) )
248
- {
249
- throw new SkipException ( "SSH not supported" ) ;
250
- }
247
+ InconclusiveIf (
248
+ ( ) =>
249
+ certType == typeof ( CertificateSsh ) && ! GlobalSettings . Version . Features . HasFlag ( BuiltInFeatures . Ssh ) ,
250
+ "SSH not supported" ) ;
251
+
252
+ bool wasCalled = false ;
253
+
251
254
252
- Assert . Throws < UserCancelledException > ( ( ) => {
253
- Repository . Clone ( url , scd . DirectoryPath , new CloneOptions ( )
255
+ Repository . Clone ( url , scd . DirectoryPath , new CloneOptions
256
+ {
257
+ CertificateCheck = ( cert , valid , host ) =>
254
258
{
255
- CertificateCheck = ( cert , valid , host ) =>
259
+ Assert . Equal ( hostname , host ) ;
260
+ Assert . Equal ( certType , cert . GetType ( ) ) ;
261
+
262
+ if ( certType == typeof ( CertificateX509 ) )
256
263
{
257
- Assert . Equal ( hostname , host ) ;
258
- Assert . Equal ( certType , cert . GetType ( ) ) ;
259
- if ( certType == typeof ( CertificateX509 ) )
260
- {
261
- Assert . True ( valid ) ;
262
- var x509 = ( ( CertificateX509 ) cert ) . Certificate ;
263
- // we get a string with the different fields instead of a structure, so...
264
- Assert . True ( x509 . Subject . Contains ( "CN=github.com," ) ) ;
265
- }
266
- else
267
- {
268
- var hostkey = ( CertificateSsh ) cert ;
269
- Assert . True ( hostkey . HasMD5 ) ;
270
- Assert . Equal ( "1627aca576282d36631b564debdfa648" , BitConverter . ToString ( hostkey . HashMD5 ) ) ;
271
- }
272
- return false ;
273
- } ,
274
- } ) ;
264
+ Assert . True ( valid ) ;
265
+ var x509 = ( ( CertificateX509 ) cert ) . Certificate ;
266
+ // we get a string with the different fields instead of a structure, so...
267
+ Assert . True ( x509 . Subject . Contains ( "CN=github.com," ) ) ;
268
+ return true ;
269
+ }
270
+
271
+ if ( certType == typeof ( CertificateSsh ) )
272
+ {
273
+ var hostkey = ( CertificateSsh ) cert ;
274
+ Assert . True ( hostkey . HasMD5 ) ;
275
+ Assert . Equal ( "1627aca576282d36631b564debdfa648" , BitConverter . ToString ( hostkey . HashMD5 ) ) ;
276
+ return true ;
277
+ }
278
+
279
+ return false ;
280
+ } ,
275
281
} ) ;
282
+
283
+ Assert . True ( wasCalled ) ;
276
284
}
277
285
278
286
[ Fact ]
0 commit comments