Skip to content

Commit

Permalink
Add test for GetInterfaces() array type (#96589)
Browse files Browse the repository at this point in the history
* Add test for GetInterfaces() array type

* Skip on mono
  • Loading branch information
stephentoub authored Jan 9, 2024
1 parent 4276583 commit 1d5f483
Showing 1 changed file with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -945,6 +945,14 @@ public void GetInterfaces(Type type, Type[] expected)
Assert.Equal(expected.OrderBy(t => t.Name), type.GetTypeInfo().GetInterfaces().OrderBy(t => t.Name));
}

[SkipOnMono("Mono returns a RuntimeType[] rather than a Type[]. https://github.com/dotnet/runtime/pull/96589")]
[Fact]
public void GetInterfaces_InvariantArrayType()
{
Assert.Equal(typeof(Type[]), typeof(int[]).GetInterfaces().GetType());
Assert.Equal(typeof(Type[]), typeof(int[]).GetTypeInfo().GetInterfaces().GetType());
}

[Theory]
[InlineData(typeof(List<>), new string[] { "T" })]
[InlineData(typeof(Dictionary<,>), new string[] { "TKey", "TValue" })]
Expand Down

0 comments on commit 1d5f483

Please sign in to comment.