@@ -270,6 +270,70 @@ public void WindowsCredentialManager_IsMatch(
270
270
Assert . Equal ( expected , actual ) ;
271
271
}
272
272
273
+ [ PlatformFact ( Platforms . Windows ) ]
274
+ public void WindowsCredentialManager_IsMatch_NoNamespace_NotMatched ( )
275
+ {
276
+ var win32Cred = new Win32Credential
277
+ {
278
+ UserName = "test" ,
279
+ TargetName = $ "{ WindowsCredentialManager . TargetNameLegacyGenericPrefix } https://example.com"
280
+ } ;
281
+
282
+ var credManager = new WindowsCredentialManager ( TestNamespace ) ;
283
+
284
+ bool result = credManager . IsMatch ( "https://example.com" , null , win32Cred ) ;
285
+
286
+ Assert . False ( result ) ;
287
+ }
288
+
289
+ [ PlatformFact ( Platforms . Windows ) ]
290
+ public void WindowsCredentialManager_IsMatch_DifferentNamespace_NotMatched ( )
291
+ {
292
+ var win32Cred = new Win32Credential
293
+ {
294
+ UserName = "test" ,
295
+ TargetName = $ "{ WindowsCredentialManager . TargetNameLegacyGenericPrefix } :random-namespace:https://example.com"
296
+ } ;
297
+
298
+ var credManager = new WindowsCredentialManager ( TestNamespace ) ;
299
+
300
+ bool result = credManager . IsMatch ( "https://example.com" , null , win32Cred ) ;
301
+
302
+ Assert . False ( result ) ;
303
+ }
304
+
305
+ [ PlatformFact ( Platforms . Windows ) ]
306
+ public void WindowsCredentialManager_IsMatch_CaseSensitiveNamespace_NotMatched ( )
307
+ {
308
+ var win32Cred = new Win32Credential
309
+ {
310
+ UserName = "test" ,
311
+ TargetName = $ "{ WindowsCredentialManager . TargetNameLegacyGenericPrefix } :nAmEsPaCe:https://example.com"
312
+ } ;
313
+
314
+ var credManager = new WindowsCredentialManager ( "namespace" ) ;
315
+
316
+ bool result = credManager . IsMatch ( "https://example.com" , null , win32Cred ) ;
317
+
318
+ Assert . False ( result ) ;
319
+ }
320
+
321
+ [ PlatformFact ( Platforms . Windows ) ]
322
+ public void WindowsCredentialManager_IsMatch_NoNamespaceInQuery_IsMatched ( )
323
+ {
324
+ var win32Cred = new Win32Credential
325
+ {
326
+ UserName = "test" ,
327
+ TargetName = $ "{ WindowsCredentialManager . TargetNameLegacyGenericPrefix } https://example.com"
328
+ } ;
329
+
330
+ var credManager = new WindowsCredentialManager ( ) ;
331
+
332
+ bool result = credManager . IsMatch ( "https://example.com" , null , win32Cred ) ;
333
+
334
+ Assert . True ( result ) ;
335
+ }
336
+
273
337
[ PlatformTheory ( Platforms . Windows ) ]
274
338
[ InlineData ( "https://example.com" , null , "https://example.com" ) ]
275
339
[ InlineData ( "https://example.com" , "bob" , "https://[email protected] " ) ]
0 commit comments