@@ -513,6 +513,19 @@ public void GetTypeByName_ValidType_ReturnsExpected(string typeName, Type expect
513
513
Assert . Equal ( expectedType , Type . GetType ( typeName . ToLower ( ) , throwOnError : false , ignoreCase : true ) ) ;
514
514
}
515
515
516
+ public static IEnumerable < object [ ] > GetTypeByName_Invalid_ClrArguments ( )
517
+ {
518
+ Type expectedException = PlatformDetection . IsMonoRuntime
519
+ ? typeof ( ArgumentException ) // https://github.com/dotnet/runtime/issues/45033
520
+ : typeof ( TypeLoadException ) ;
521
+
522
+ yield return new object [ ] { "System.Int32&&" , expectedException , true } ;
523
+ yield return new object [ ] { "System.Int32&*" , expectedException , true } ;
524
+ yield return new object [ ] { "System.Int32&[]" , expectedException , true } ;
525
+ yield return new object [ ] { "System.Int32&[*]" , expectedException , true } ;
526
+ yield return new object [ ] { "System.Int32&[,]" , expectedException , true } ;
527
+ }
528
+
516
529
[ Theory ]
517
530
[ InlineData ( "system.nullable`1[system.int32]" , typeof ( TypeLoadException ) , false ) ]
518
531
[ InlineData ( "System.NonExistingType" , typeof ( TypeLoadException ) , false ) ]
@@ -522,11 +535,7 @@ public void GetTypeByName_ValidType_ReturnsExpected(string typeName, Type expect
522
535
[ InlineData ( "Outside`1[System.Boolean, System.Int32]" , typeof ( ArgumentException ) , true ) ]
523
536
[ InlineData ( ".System.Int32" , typeof ( TypeLoadException ) , false ) ]
524
537
[ InlineData ( "..Outside`1" , typeof ( TypeLoadException ) , false ) ]
525
- [ InlineData ( "System.Int32&&" , typeof ( TypeLoadException ) , false ) ]
526
- [ InlineData ( "System.Int32&*" , typeof ( TypeLoadException ) , false ) ]
527
- [ InlineData ( "System.Int32&[]" , typeof ( TypeLoadException ) , false ) ]
528
- [ InlineData ( "System.Int32&[*]" , typeof ( TypeLoadException ) , false ) ]
529
- [ InlineData ( "System.Int32&[,]" , typeof ( TypeLoadException ) , false ) ]
538
+ [ MemberData ( nameof ( GetTypeByName_Invalid_ClrArguments ) ) ]
530
539
public void GetTypeByName_Invalid ( string typeName , Type expectedException , bool alwaysThrowsException )
531
540
{
532
541
if ( ! alwaysThrowsException )
0 commit comments