From 76b4237cf1c422e332e213a75ffa98293646be88 Mon Sep 17 00:00:00 2001 From: Rose <83477269+AtariDreams@users.noreply.github.com> Date: Tue, 25 Oct 2022 12:35:40 -0400 Subject: [PATCH] [Tests]Fix Unit Test to compile under .NET 5 and up (#21229) .NET Framework has the previous function, but .NET Core does not support it. This is so we can keep compiling this code under new frameworks. --- .../Programs/UWPTests.cs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/modules/launcher/Plugins/Microsoft.Plugin.Program.UnitTests/Programs/UWPTests.cs b/src/modules/launcher/Plugins/Microsoft.Plugin.Program.UnitTests/Programs/UWPTests.cs index c0dacc4683..a70055c351 100644 --- a/src/modules/launcher/Plugins/Microsoft.Plugin.Program.UnitTests/Programs/UWPTests.cs +++ b/src/modules/launcher/Plugins/Microsoft.Plugin.Program.UnitTests/Programs/UWPTests.cs @@ -2,6 +2,7 @@ // The Microsoft Corporation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. +using System; using System.Collections.Generic; using Castle.Core.Internal; using Microsoft.Plugin.Program.Programs; @@ -52,8 +53,8 @@ namespace Microsoft.Plugin.Program.UnitTests.Programs // Assert Assert.AreEqual(2, applications.Length); - Assert.IsTrue(applications.FindAll(x => x.Name == "DevelopmentApp").Length > 0); - Assert.IsTrue(applications.FindAll(x => x.Name == "PackagedApp").Length > 0); + Assert.IsTrue(Array.FindAll(applications, x => x.Name == "DevelopmentApp").Length > 0); + Assert.IsTrue(Array.FindAll(applications, x => x.Name == "PackagedApp").Length > 0); } [TestMethod] @@ -71,7 +72,7 @@ namespace Microsoft.Plugin.Program.UnitTests.Programs // Assert Assert.AreEqual(1, applications.Length); - Assert.IsTrue(applications.FindAll(x => x.Name == "PackagedApp").Length > 0); + Assert.IsTrue(Array.FindAll(applications, x => x.Name == "PackagedApp").Length > 0); } [TestMethod]