Skip to content

Commit

Permalink
Fixed up ref comments
Browse files Browse the repository at this point in the history
  • Loading branch information
OsirisTerje committed Feb 20, 2023
1 parent 49001ac commit 0d4a295
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,10 @@ public static IEnumerable<RuntimeFramework> FindDotNetCoreFrameworks()

foreach (string dirName in GetRuntimeDirectories())
{
Version newVersion;
if (TryGetVersionFromString(dirName, out newVersion) && !alreadyFound.Contains(newVersion))
if (TryGetVersionFromString(dirName, out var newVersion) && !alreadyFound.Contains(newVersion))
{
alreadyFound.Add(newVersion);
// HACK: Avoid Exception for an unknown version - see issue #1223
// Requires change in RuntimeFramework.GetClrVersionForFramework()
if (newVersion.Major <= 8)
yield return new RuntimeFramework(RuntimeType.NetCore, newVersion);
else
log.Error($"Found .NET {newVersion.ToString(2)}, which is not yet supported.");
yield return new RuntimeFramework(RuntimeType.NetCore, newVersion);
}
}

Expand Down Expand Up @@ -76,7 +70,7 @@ private static IEnumerable<string> GetRuntimeList()
{
process.Start();
}
catch(Exception)
catch (Exception)
{
// No versions are installed, just return
yield break;
Expand Down
9 changes: 2 additions & 7 deletions src/NUnitEngine/nunit.engine.core/RuntimeFramework.cs
Original file line number Diff line number Diff line change
Expand Up @@ -200,14 +200,9 @@ private Version GetClrVersionForFramework(Version frameworkVersion)
return new Version(3, 1, 10);
case 5:
return new Version(5, 0, 1);
case 6:
return new Version(6, 0, 0);
case 7:
return new Version(7, 0, 0);
case 8:
return new Version(8, 0, 0);
default:
return new Version(frameworkVersion.Major, 0, 0);
}
break;
}

throw new ArgumentException("Unknown framework version " + frameworkVersion.ToString(), "version");
Expand Down

0 comments on commit 0d4a295

Please sign in to comment.