Skip to content

Commit

Permalink
Upgrade PackageHealthTest to test for net8.
Browse files Browse the repository at this point in the history
  • Loading branch information
claudiamurialdo committed Oct 31, 2023
1 parent 4f8670d commit 47d631b
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions dotnet/test/ProjectHealthTest/PackageVersionsConsistency.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public class PackageVersionTest
private const string PACKAGE_VERSION_ATTRIBUTE_NAME = "Version";
private const string TARGET_FRAMEWORK = "Project/PropertyGroup/TargetFramework";
private const string TARGET_FRAMEWORKS = "Project/PropertyGroup/TargetFrameworks";
private const string NET6 = "net6.0";
private const string NET8 = "net8.0";
private const string NET_FRAMEWORK = "net462";
private static HashSet<string> ExcludedFromTransitiveDependenciesControl = new HashSet<string> {"runtime"};
private static HashSet<string> ProjectTemporaryExcludedFromDependenciesControl = new HashSet<string> { "GeneXus.Deploy.AzureFunctions.Handlers.csproj", "AzureFunctionsTest.csproj" };
Expand All @@ -35,7 +35,7 @@ public class PackageVersionTest
[Fact]
public void TestPackageVersionConsistencyAcrossNETProjectsAndTransitives()
{
TestPackageVersionConsistencyAcrossProjects(NET6, true);
TestPackageVersionConsistencyAcrossProjects(NET8, true);
}
/// <summary>
/// Tests that all referenced packages have the same version by doing:
Expand All @@ -47,7 +47,7 @@ public void TestPackageVersionConsistencyAcrossNETProjectsAndTransitives()
[Fact]
public void TestPackageVersionConsistencyAcrossNETProjects()
{
TestPackageVersionConsistencyAcrossProjects(NET6, false);
TestPackageVersionConsistencyAcrossProjects(NET8, false);
}
[Fact]
public void TestPackageVersionConsistencyAcrossNETFrameworkProjects()
Expand Down Expand Up @@ -100,9 +100,9 @@ private void TestPackageVersionConsistencyAcrossProjects(string targetFramework,
{
XmlAttribute condition = packageNode.ParentNode.Attributes["Condition"];
if (condition != null) {
if (targetFramework == NET6 && condition.Value.Contains($"=='{NET_FRAMEWORK}'", StringComparison.OrdinalIgnoreCase))
if (targetFramework == NET8 && condition.Value.Contains($"=='{NET_FRAMEWORK}'", StringComparison.OrdinalIgnoreCase))
continue;
else if (targetFramework == NET_FRAMEWORK && condition.Value.Contains($"=='{NET6}'", StringComparison.OrdinalIgnoreCase))
else if (targetFramework == NET_FRAMEWORK && condition.Value.Contains($"=='{NET8}'", StringComparison.OrdinalIgnoreCase))
{
continue;
}
Expand Down

0 comments on commit 47d631b

Please sign in to comment.