[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.
This commit is contained in:
Rose
2022-10-25 12:35:40 -04:00
committed by GitHub
parent 19c4255c7d
commit 76b4237cf1

View File

@@ -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]