@@ -60,10 +60,10 @@ private static Func<string> GetAssemblyLocationInfoMethodCall()
6060 return Expression . Lambda < Func < string > > ( methodCall , Array . Empty < ParameterExpression > ( ) ) . Compile ( ) ;
6161 }
6262
63- public static string TestAssemblyLocationInfoMethod ( )
64- {
65- return SystemInfo . AssemblyLocationInfo ( Assembly . GetCallingAssembly ( ) ) ;
66- }
63+ [ System . Diagnostics . CodeAnalysis . SuppressMessage ( "Structure" , "NUnit1028:The non-test method is public" ,
64+ Justification = "Reflection" ) ]
65+ public static string TestAssemblyLocationInfoMethod ( )
66+ => SystemInfo . AssemblyLocationInfo ( Assembly . GetCallingAssembly ( ) ) ;
6767
6868 [ Test ]
6969 public void TestGetTypeFromStringFullyQualified ( )
@@ -131,9 +131,10 @@ public void TestGetTypeFromStringFails1()
131131 Type ? t ;
132132
133133 t = GetTypeFromString ( "LOG4NET.TESTS.UTIL.SYSTEMINFOTEST,LOG4NET.TESTS" , false , false ) ;
134- Assert . That ( t , Is . SameAs ( null ) , "Test explicit case sensitive fails type load" ) ;
134+ Assert . That ( t , Is . Null , "Test explicit case sensitive fails type load" ) ;
135135
136- Assert . Throws < TypeLoadException > ( ( ) => GetTypeFromString ( "LOG4NET.TESTS.UTIL.SYSTEMINFOTEST,LOG4NET.TESTS" , true , false ) ) ;
136+ Assert . Throws < TypeLoadException > (
137+ ( ) => GetTypeFromString ( "LOG4NET.TESTS.UTIL.SYSTEMINFOTEST,LOG4NET.TESTS" , true , false ) ) ;
137138 }
138139
139140 [ Test ]
@@ -142,52 +143,38 @@ public void TestGetTypeFromStringFails2()
142143 Type ? t ;
143144
144145 t = GetTypeFromString ( "LOG4NET.TESTS.UTIL.SYSTEMINFOTEST" , false , false ) ;
145- Assert . That ( t , Is . SameAs ( null ) , "Test explicit case sensitive fails type load" ) ;
146+ Assert . That ( t , Is . Null , "Test explicit case sensitive fails type load" ) ;
146147
147148 Assert . Throws < TypeLoadException > ( ( ) => GetTypeFromString ( "LOG4NET.TESTS.UTIL.SYSTEMINFOTEST" , true , false ) ) ;
148149 }
149150
150151 // Wraps SystemInfo.GetTypeFromString because the method relies on GetCallingAssembly, which is
151152 // unavailable in CoreFX. As a workaround, only overloads which explicitly take a Type or Assembly
152153 // are exposed for NETSTANDARD1_3.
153- private Type ? GetTypeFromString ( string typeName , bool throwOnError , bool ignoreCase )
154- {
155- return SystemInfo . GetTypeFromString ( typeName , throwOnError , ignoreCase ) ;
156- }
154+ private static Type ? GetTypeFromString ( string typeName , bool throwOnError , bool ignoreCase )
155+ => SystemInfo . GetTypeFromString ( typeName , throwOnError , ignoreCase ) ;
157156
158157 [ Test ]
159- public void EqualsIgnoringCase_BothNull_true ( )
160- {
161- Assert . True ( SystemInfo . EqualsIgnoringCase ( null , null ) ) ;
162- }
158+ public void EqualsIgnoringCase_BothNull_true ( )
159+ => Assert . That ( SystemInfo . EqualsIgnoringCase ( null , null ) , Is . True ) ;
163160
164161 [ Test ]
165- public void EqualsIgnoringCase_LeftNull_false ( )
166- {
167- Assert . False ( SystemInfo . EqualsIgnoringCase ( null , "foo" ) ) ;
168- }
162+ public void EqualsIgnoringCase_LeftNull_false ( )
163+ => Assert . That ( SystemInfo . EqualsIgnoringCase ( null , "foo" ) , Is . False ) ;
169164
170165 [ Test ]
171- public void EqualsIgnoringCase_RightNull_false ( )
172- {
173- Assert . False ( SystemInfo . EqualsIgnoringCase ( "foo" , null ) ) ;
174- }
166+ public void EqualsIgnoringCase_RightNull_false ( )
167+ => Assert . That ( SystemInfo . EqualsIgnoringCase ( "foo" , null ) , Is . False ) ;
175168
176169 [ Test ]
177- public void EqualsIgnoringCase_SameStringsSameCase_true ( )
178- {
179- Assert . True ( SystemInfo . EqualsIgnoringCase ( "foo" , "foo" ) ) ;
180- }
170+ public void EqualsIgnoringCase_SameStringsSameCase_true ( )
171+ => Assert . That ( SystemInfo . EqualsIgnoringCase ( "foo" , "foo" ) , Is . True ) ;
181172
182173 [ Test ]
183- public void EqualsIgnoringCase_SameStringsDifferentCase_true ( )
184- {
185- Assert . True ( SystemInfo . EqualsIgnoringCase ( "foo" , "FOO" ) ) ;
186- }
174+ public void EqualsIgnoringCase_SameStringsDifferentCase_true ( )
175+ => Assert . That ( SystemInfo . EqualsIgnoringCase ( "foo" , "FOO" ) , Is . True ) ;
187176
188177 [ Test ]
189- public void EqualsIgnoringCase_DifferentStrings_false ( )
190- {
191- Assert . False ( SystemInfo . EqualsIgnoringCase ( "foo" , "foobar" ) ) ;
192- }
178+ public void EqualsIgnoringCase_DifferentStrings_false ( )
179+ => Assert . That ( SystemInfo . EqualsIgnoringCase ( "foo" , "foobar" ) , Is . False ) ;
193180}
0 commit comments