@@ -73,6 +73,39 @@ public void Test_TypeExtensions_NestedTypes(string name, Type type)
7373 Assert . AreEqual ( name , type . ToTypeString ( ) ) ;
7474 }
7575
76+ #pragma warning disable SA1015 // Closing generic brackets should be spaced correctly
77+ [ TestCategory ( "TypeExtensions" ) ]
78+ [ TestMethod ]
79+ [ DataRow ( "void*" , typeof ( void * ) ) ]
80+ [ DataRow ( "int**" , typeof ( int * * ) ) ]
81+ [ DataRow ( "byte***" , typeof ( byte * * * ) ) ]
82+ [ DataRow ( "System.Guid*" , typeof ( Guid * ) ) ]
83+ [ DataRow ( "UnitTests.Extensions.Foo<int>*" , typeof ( Foo < int > * ) ) ]
84+ [ DataRow ( "UnitTests.Extensions.Test_TypeExtensions.Animal.Cat**" , typeof ( Animal . Cat * * ) ) ]
85+ [ DataRow ( "UnitTests.Extensions.Test_TypeExtensions.Animal.Cat<int>*" , typeof ( Animal . Cat < int > * ) ) ]
86+ [ DataRow ( "UnitTests.Extensions.Test_TypeExtensions.Animal.Cat<float>.Bar**" , typeof ( Animal . Cat < float > . Bar * * ) ) ]
87+ [ DataRow ( "UnitTests.Extensions.Test_TypeExtensions.Animal.Cat<double>.Bar<int>***" , typeof ( Animal . Cat < double > . Bar < int > * * * ) ) ]
88+ public void Test_TypeExtensions_PointerTypes ( string name , Type type )
89+ {
90+ Assert . AreEqual ( name , type . ToTypeString ( ) ) ;
91+ }
92+ #pragma warning restore SA1015
93+
94+ [ TestCategory ( "TypeExtensions" ) ]
95+ [ TestMethod ]
96+ [ DataRow ( "int&" , typeof ( int ) ) ]
97+ [ DataRow ( "byte&" , typeof ( byte ) ) ]
98+ [ DataRow ( "System.Guid&" , typeof ( Guid ) ) ]
99+ [ DataRow ( "UnitTests.Extensions.Foo<int>&" , typeof ( Foo < int > ) ) ]
100+ [ DataRow ( "UnitTests.Extensions.Test_TypeExtensions.Animal.Cat&" , typeof ( Animal . Cat ) ) ]
101+ [ DataRow ( "UnitTests.Extensions.Test_TypeExtensions.Animal.Cat<int>&" , typeof ( Animal . Cat < int > ) ) ]
102+ [ DataRow ( "UnitTests.Extensions.Test_TypeExtensions.Animal.Cat<float>.Bar&" , typeof ( Animal . Cat < float > . Bar ) ) ]
103+ [ DataRow ( "UnitTests.Extensions.Test_TypeExtensions.Animal.Cat<double>.Bar<int>&" , typeof ( Animal . Cat < double > . Bar < int > ) ) ]
104+ public void Test_TypeExtensions_RefTypes ( string name , Type type )
105+ {
106+ Assert . AreEqual ( name , type . MakeByRefType ( ) . ToTypeString ( ) ) ;
107+ }
108+
76109 private class Animal
77110 {
78111 public struct Cat
0 commit comments