mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-08 20:27:36 +02:00
[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:
@@ -2,6 +2,7 @@
|
|||||||
// The Microsoft Corporation licenses this file to you under the MIT license.
|
// The Microsoft Corporation licenses this file to you under the MIT license.
|
||||||
// See the LICENSE file in the project root for more information.
|
// See the LICENSE file in the project root for more information.
|
||||||
|
|
||||||
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using Castle.Core.Internal;
|
using Castle.Core.Internal;
|
||||||
using Microsoft.Plugin.Program.Programs;
|
using Microsoft.Plugin.Program.Programs;
|
||||||
@@ -52,8 +53,8 @@ namespace Microsoft.Plugin.Program.UnitTests.Programs
|
|||||||
|
|
||||||
// Assert
|
// Assert
|
||||||
Assert.AreEqual(2, applications.Length);
|
Assert.AreEqual(2, applications.Length);
|
||||||
Assert.IsTrue(applications.FindAll(x => x.Name == "DevelopmentApp").Length > 0);
|
Assert.IsTrue(Array.FindAll(applications, x => x.Name == "DevelopmentApp").Length > 0);
|
||||||
Assert.IsTrue(applications.FindAll(x => x.Name == "PackagedApp").Length > 0);
|
Assert.IsTrue(Array.FindAll(applications, x => x.Name == "PackagedApp").Length > 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
[TestMethod]
|
[TestMethod]
|
||||||
@@ -71,7 +72,7 @@ namespace Microsoft.Plugin.Program.UnitTests.Programs
|
|||||||
|
|
||||||
// Assert
|
// Assert
|
||||||
Assert.AreEqual(1, applications.Length);
|
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]
|
[TestMethod]
|
||||||
|
|||||||
Reference in New Issue
Block a user