From 7ba7a66a76302820f2afed6108af900da9500b2a Mon Sep 17 00:00:00 2001 From: Nick Guerrera Date: Thu, 18 May 2017 14:49:45 -0700 Subject: [PATCH] Add cross-targeting coverage --- .../GivenThatWeWantToBuildADesktopExe.cs | 25 +++++++++++++++---- 1 file changed, 20 insertions(+), 5 deletions(-) diff --git a/test/Microsoft.NET.Build.Tests/GivenThatWeWantToBuildADesktopExe.cs b/test/Microsoft.NET.Build.Tests/GivenThatWeWantToBuildADesktopExe.cs index 8aca26f4a573..cb1c1fc5709a 100644 --- a/test/Microsoft.NET.Build.Tests/GivenThatWeWantToBuildADesktopExe.cs +++ b/test/Microsoft.NET.Build.Tests/GivenThatWeWantToBuildADesktopExe.cs @@ -378,13 +378,28 @@ public void It_generates_binding_redirects_if_needed() }); } - [WindowsOnlyFact] - public void It_places_package_satellites_correctly() + [WindowsOnlyTheory] + [InlineData(true)] + [InlineData(false)] + public void It_places_package_satellites_correctly(bool crossTarget) { var testAsset = _testAssetsManager - .CopyTestAsset("DesktopUsingPackageWithSatellites") - .WithSource() - .Restore(Log); + .CopyTestAsset( + "DesktopUsingPackageWithSatellites", + identifier: crossTarget ? "_cross" : "") + .WithSource(); + + if (crossTarget) + { + testAsset = testAsset.WithProjectChanges(project => + { + var ns = project.Root.Name.Namespace; + var propertyGroup = project.Root.Elements(ns + "PropertyGroup").First(); + propertyGroup.Element(ns + "TargetFramework").Name += "s"; + }); + } + + testAsset.Restore(Log); var buildCommand = new BuildCommand(Log, testAsset.TestRoot); buildCommand