File tree Expand file tree Collapse file tree 1 file changed +0
-49
lines changed
src/NUnitEngine/nunit.engine.core/Internal Expand file tree Collapse file tree 1 file changed +0
-49
lines changed Original file line number Diff line number Diff line change @@ -255,55 +255,6 @@ public AspNetCoreStrategy() : base("Microsoft.AspNetCore.App") { }
255255 }
256256
257257 #endregion
258-
259- #region HelperMethods
260-
261- private static string FindBestVersionDir ( string libraryDir , Version targetVersion )
262- {
263- string target = targetVersion . ToString ( ) ;
264- Version bestVersion = new Version ( 0 , 0 ) ;
265- foreach ( var subdir in Directory . GetDirectories ( libraryDir ) )
266- {
267- Version version ;
268- if ( TryGetVersionFromString ( Path . GetFileName ( subdir ) , out version ) )
269- {
270- if ( version >= targetVersion )
271- if ( bestVersion . Major == 0 || bestVersion > version )
272- bestVersion = version ;
273- }
274- }
275-
276- return bestVersion . Major > 0
277- ? bestVersion . ToString ( )
278- : null ;
279- }
280-
281- private static bool TryGetVersionFromString ( string text , out Version newVersion )
282- {
283- const string VERSION_CHARS = ".0123456789" ;
284-
285- int len = 0 ;
286- foreach ( char c in text )
287- {
288- if ( VERSION_CHARS . IndexOf ( c ) >= 0 )
289- len ++ ;
290- else
291- break ;
292- }
293-
294- try
295- {
296- newVersion = new Version ( text . Substring ( 0 , len ) ) ;
297- return true ;
298- }
299- catch
300- {
301- newVersion = new Version ( ) ;
302- return false ;
303- }
304- }
305-
306- #endregion
307258 }
308259}
309260#endif
You can’t perform that action at this time.
0 commit comments