From dae165df97460166f572a583e322c2553d2c680a Mon Sep 17 00:00:00 2001 From: Arlo Godfrey Date: Wed, 30 Oct 2024 21:18:41 -0500 Subject: [PATCH] Prevent tests from running under wasdk, workaround for missing MultiTarget/csproj support in https://github.com/CommunityToolkit/Tooling-Windows-Submodule/issues/101 --- components/Notifications/tests/TestAssertHelper.cs | 3 +++ components/Notifications/tests/TestMail.cs | 3 +++ components/Notifications/tests/TestTileContentBuilder.cs | 3 +++ components/Notifications/tests/TestToastArguments.cs | 3 +++ components/Notifications/tests/TestToastContentBuilder.cs | 3 +++ components/Notifications/tests/TestWeather.cs | 3 +++ components/Notifications/tests/Test_Adaptive_Xml.cs | 3 +++ components/Notifications/tests/Test_Badge_Xml.cs | 3 +++ components/Notifications/tests/Test_Tile_Xml.cs | 3 +++ components/Notifications/tests/Test_Toast_Xml.cs | 3 +++ components/Notifications/tests/TextXboxModern.cs | 3 +++ 11 files changed, 33 insertions(+) diff --git a/components/Notifications/tests/TestAssertHelper.cs b/components/Notifications/tests/TestAssertHelper.cs index 7977768c7..aaef76806 100644 --- a/components/Notifications/tests/TestAssertHelper.cs +++ b/components/Notifications/tests/TestAssertHelper.cs @@ -2,6 +2,8 @@ // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. +#if WINDOWS_UWP + using System; using System.Collections.Generic; using System.IO; @@ -449,3 +451,4 @@ private static void ParseXml(XmlReader reader, MyXmlElement intoElement) } } } +#endif diff --git a/components/Notifications/tests/TestMail.cs b/components/Notifications/tests/TestMail.cs index 5a56fb751..3d76ce9b1 100644 --- a/components/Notifications/tests/TestMail.cs +++ b/components/Notifications/tests/TestMail.cs @@ -2,6 +2,8 @@ // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. +#if WINDOWS_UWP + using CommunityToolkit.Notifications; using Microsoft.VisualStudio.TestTools.UnitTesting; @@ -166,3 +168,4 @@ private static AdaptiveGroup GenerateMessage(string from, string subject, string } } } +#endif diff --git a/components/Notifications/tests/TestTileContentBuilder.cs b/components/Notifications/tests/TestTileContentBuilder.cs index 179b626cb..576049b4a 100644 --- a/components/Notifications/tests/TestTileContentBuilder.cs +++ b/components/Notifications/tests/TestTileContentBuilder.cs @@ -2,6 +2,8 @@ // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. +#if WINDOWS_UWP + using System.Linq; using CommunityToolkit.Notifications; using Microsoft.VisualStudio.TestTools.UnitTesting; @@ -110,3 +112,4 @@ private static AdaptiveText GetTileAdaptiveText(TileContentBuilder builder, Tile } } } +#endif diff --git a/components/Notifications/tests/TestToastArguments.cs b/components/Notifications/tests/TestToastArguments.cs index 4a52aa01e..88f5cbd00 100644 --- a/components/Notifications/tests/TestToastArguments.cs +++ b/components/Notifications/tests/TestToastArguments.cs @@ -2,6 +2,8 @@ // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. +#if WINDOWS_UWP + using System; using System.Collections.Generic; using System.Linq; @@ -497,3 +499,4 @@ private static bool IsSame(ToastArguments expected, ToastArguments actual) } } } +#endif diff --git a/components/Notifications/tests/TestToastContentBuilder.cs b/components/Notifications/tests/TestToastContentBuilder.cs index b786c65ee..1ea03b124 100644 --- a/components/Notifications/tests/TestToastContentBuilder.cs +++ b/components/Notifications/tests/TestToastContentBuilder.cs @@ -2,6 +2,8 @@ // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. +#if WINDOWS_UWP + using System; using System.Linq; using CommunityToolkit.Notifications; @@ -1196,3 +1198,4 @@ public void AddComboBoxTest_WithMultipleChoiceAndDefaultSelectedAndTitle_ReturnS } } } +#endif diff --git a/components/Notifications/tests/TestWeather.cs b/components/Notifications/tests/TestWeather.cs index 2ae75f69e..a171dfabb 100644 --- a/components/Notifications/tests/TestWeather.cs +++ b/components/Notifications/tests/TestWeather.cs @@ -2,6 +2,8 @@ // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. +#if WINDOWS_UWP + using CommunityToolkit.Notifications; using Microsoft.VisualStudio.TestTools.UnitTesting; @@ -290,3 +292,4 @@ private static AdaptiveSubgroup GenerateLargeSubgroup(string day, string image, } } } +#endif diff --git a/components/Notifications/tests/Test_Adaptive_Xml.cs b/components/Notifications/tests/Test_Adaptive_Xml.cs index ff0447af6..bbf50d7cf 100644 --- a/components/Notifications/tests/Test_Adaptive_Xml.cs +++ b/components/Notifications/tests/Test_Adaptive_Xml.cs @@ -2,6 +2,8 @@ // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. +#if WINDOWS_UWP + using System; using CommunityToolkit.Notifications; using Microsoft.VisualStudio.TestTools.UnitTesting; @@ -595,3 +597,4 @@ private static void AssertAdaptiveChildInTile(string expectedAdaptiveChildXml, I } } } +#endif diff --git a/components/Notifications/tests/Test_Badge_Xml.cs b/components/Notifications/tests/Test_Badge_Xml.cs index 8dcab5e50..5ed17506f 100644 --- a/components/Notifications/tests/Test_Badge_Xml.cs +++ b/components/Notifications/tests/Test_Badge_Xml.cs @@ -2,6 +2,8 @@ // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. +#if WINDOWS_UWP + using CommunityToolkit.Notifications; using Microsoft.VisualStudio.TestTools.UnitTesting; @@ -72,3 +74,4 @@ private static void AssertPayload(string expectedXml, INotificationContent notif } } } +#endif diff --git a/components/Notifications/tests/Test_Tile_Xml.cs b/components/Notifications/tests/Test_Tile_Xml.cs index 745248c16..f648c2b69 100644 --- a/components/Notifications/tests/Test_Tile_Xml.cs +++ b/components/Notifications/tests/Test_Tile_Xml.cs @@ -2,6 +2,8 @@ // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. +#if WINDOWS_UWP + using System; using CommunityToolkit.Notifications; using Microsoft.VisualStudio.TestTools.UnitTesting; @@ -1674,3 +1676,4 @@ private static void AssertPayload(string expectedXml, TileContent tile) } } } +#endif diff --git a/components/Notifications/tests/Test_Toast_Xml.cs b/components/Notifications/tests/Test_Toast_Xml.cs index 328771307..e1144a6ec 100644 --- a/components/Notifications/tests/Test_Toast_Xml.cs +++ b/components/Notifications/tests/Test_Toast_Xml.cs @@ -2,6 +2,8 @@ // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. +#if WINDOWS_UWP + using System; using CommunityToolkit.Notifications; using Microsoft.VisualStudio.TestTools.UnitTesting; @@ -2190,3 +2192,4 @@ private static void AssertPayload(string expectedXml, ToastContent toast) } } } +#endif diff --git a/components/Notifications/tests/TextXboxModern.cs b/components/Notifications/tests/TextXboxModern.cs index e98a1220b..1ffd054aa 100644 --- a/components/Notifications/tests/TextXboxModern.cs +++ b/components/Notifications/tests/TextXboxModern.cs @@ -2,6 +2,8 @@ // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. +#if WINDOWS_UWP + using CommunityToolkit.Notifications; using Microsoft.VisualStudio.TestTools.UnitTesting; @@ -161,3 +163,4 @@ public void TestXboxModernTile() } } } +#endif