From 74b72b6361e31d306e9b9879bb284fb6e485dab9 Mon Sep 17 00:00:00 2001 From: Brandon Ording Date: Fri, 26 Jan 2024 14:42:06 -0500 Subject: [PATCH] Add failing test scenarios --- .../Utilities/MSBuildHelperTests.cs | 52 +++++++++++++++++++ 1 file changed, 52 insertions(+) diff --git a/nuget/helpers/lib/NuGetUpdater/NuGetUpdater.Core.Test/Utilities/MSBuildHelperTests.cs b/nuget/helpers/lib/NuGetUpdater/NuGetUpdater.Core.Test/Utilities/MSBuildHelperTests.cs index 6bd5d65359..839ba1f23b 100644 --- a/nuget/helpers/lib/NuGetUpdater/NuGetUpdater.Core.Test/Utilities/MSBuildHelperTests.cs +++ b/nuget/helpers/lib/NuGetUpdater/NuGetUpdater.Core.Test/Utilities/MSBuildHelperTests.cs @@ -462,6 +462,32 @@ public static IEnumerable GetTopLevelPackageDependenyInfosTestData() } }; + // version is a property not triggered by a quoted condition + yield return new object[] + { + // build file contents + new[] + { + ("project.csproj", """ + + + netstandard2.0 + 12.0.1 + 13.0.1 + + + + + + """) + }, + // expected dependencies + new Dependency[] + { + new("Newtonsoft.Json", "12.0.1", DependencyType.Unknown) + } + }; + // version is a property with a condition checking for an empty string yield return new object[] { @@ -488,6 +514,32 @@ public static IEnumerable GetTopLevelPackageDependenyInfosTestData() } }; + // version is a property with a quoted condition checking for an empty string + yield return new object[] + { + // build file contents + new[] + { + ("project.csproj", """ + + + netstandard2.0 + 12.0.1 + 13.0.1 + + + + + + """) + }, + // expected dependencies + new Dependency[] + { + new("Newtonsoft.Json", "12.0.1", DependencyType.Unknown) + } + }; + // version is set in one file, used in another yield return new object[] {