From 924b0beeb3147ae6a3d011296442c6bcf7403047 Mon Sep 17 00:00:00 2001 From: Rolf Bjarne Kvinge Date: Thu, 15 Feb 2024 13:43:20 +0100 Subject: [PATCH] [tests] Fix the MlaunchTest.GetMlaunchRunArguments in a more future-proof way. --- tests/dotnet/UnitTests/MlaunchTest.cs | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/tests/dotnet/UnitTests/MlaunchTest.cs b/tests/dotnet/UnitTests/MlaunchTest.cs index 5e22dd7287f..e7d23883f4a 100644 --- a/tests/dotnet/UnitTests/MlaunchTest.cs +++ b/tests/dotnet/UnitTests/MlaunchTest.cs @@ -49,10 +49,17 @@ public void GetMlaunchInstallArguments (ApplePlatform platform, string runtimeId Assert.AreEqual (expectedScriptContents, scriptContents, "Script contents"); } + public static object[] GetMlaunchRunArgumentsTestCases () + { + return new object[] { + new object [] {ApplePlatform.iOS, "iossimulator-x64;iossimulator-arm64", $":v2:runtime=com.apple.CoreSimulator.SimRuntime.iOS-{SdkVersions.iOS.Replace('.', '-')},devicetype=com.apple.CoreSimulator.SimDeviceType.iPhone-15-Pro" }, + new object [] {ApplePlatform.iOS, "ios-arm64", "" }, + new object [] {ApplePlatform.TVOS, "tvossimulator-arm64", $":v2:runtime=com.apple.CoreSimulator.SimRuntime.tvOS-{SdkVersions.TVOS.Replace('.', '-')},devicetype=com.apple.CoreSimulator.SimDeviceType.Apple-TV-4K-3rd-generation-1080p" }, + }; + } + [Test] - [TestCase (ApplePlatform.iOS, "iossimulator-x64;iossimulator-arm64", ":v2:runtime=com.apple.CoreSimulator.SimRuntime.iOS-17-2,devicetype=com.apple.CoreSimulator.SimDeviceType.iPhone-15-Pro")] - [TestCase (ApplePlatform.iOS, "ios-arm64", "")] - [TestCase (ApplePlatform.TVOS, "tvossimulator-arm64", ":v2:runtime=com.apple.CoreSimulator.SimRuntime.tvOS-17-2,devicetype=com.apple.CoreSimulator.SimDeviceType.Apple-TV-4K-3rd-generation-1080p")] + [TestCaseSource (nameof (GetMlaunchRunArgumentsTestCases))] public void GetMlaunchRunArguments (ApplePlatform platform, string runtimeIdentifiers, string device) { var project = "MySimpleApp";