From 26acc45cd5c5a65e5109ff905b894d583335f536 Mon Sep 17 00:00:00 2001 From: Daniel Cazzulino Date: Thu, 8 Aug 2024 06:30:23 -0300 Subject: [PATCH] Make test less dependent on specific workload version installed --- .../given_multitargeting_libraries.cs | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/src/NuGetizer.Tests/given_multitargeting_libraries.cs b/src/NuGetizer.Tests/given_multitargeting_libraries.cs index 9edf69be..8e83952a 100644 --- a/src/NuGetizer.Tests/given_multitargeting_libraries.cs +++ b/src/NuGetizer.Tests/given_multitargeting_libraries.cs @@ -57,14 +57,12 @@ public void when_getting_content_then_multitargets() { PackagePath = "lib/net8.0/uilibrary.dll" })); - Assert.Contains(result.Items, item => item.Matches(new - { - PackagePath = "lib/net8.0-windows7.0/uilibrary.dll" - })); - Assert.Contains(result.Items, item => item.Matches(new - { - PackagePath = "lib/net8.0-maccatalyst17.2/uilibrary.dll" - })); + + Assert.Contains(result.Items, item => item.TryGetMetadata("PackagePath", out var path) && + path.StartsWith("lib/net8.0-windows") && path.EndsWith("uilibrary.dll")); + + Assert.Contains(result.Items, item => item.TryGetMetadata("PackagePath", out var path) && + path.StartsWith("lib/net8.0-maccatalyst") && path.EndsWith("uilibrary.dll")); } } }