Skip to content
This repository was archived by the owner on Jul 1, 2026. It is now read-only.

Commit e382113

Browse files
[tests] Use simple assertion for ManagedPeer test (#1435)
Avoid CollectionAssert.Contains so the test continues to compile in dotnet/android, where only the simple NUnit assertions are available. ### Add LINQ import for ManagedPeer test The simple assertion uses Enumerable.Contains, so add the explicit System.Linq import for projects without implicit usings. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 41d01af commit e382113

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

tests/Java.Interop-Tests/Java.Interop/JniRuntimeTest.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
using System;
22
using System.Reflection;
33
using System.Collections.Generic;
4+
using System.Linq;
45
using System.Threading;
56

67
using Java.Interop;
@@ -70,7 +71,7 @@ public void CreateJavaVMWithNullBuilder ()
7071
public void BuiltInSimpleReferenceMap_ContainsManagedPeerByDefault ()
7172
{
7273
var types = JniRuntime.CurrentRuntime.TypeManager.GetTypes (new JniTypeSignature (ManagedPeer.JniTypeName));
73-
CollectionAssert.Contains (types, typeof (ManagedPeer));
74+
Assert.IsTrue (types.Contains (typeof (ManagedPeer)));
7475
}
7576

7677
#if !__ANDROID__

0 commit comments

Comments
 (0)