Disable STJ reflection for testing. (#266)
* Disable STJ reflection for testing. * Remove params method and redundant overload. --------- Co-authored-by: Stephen Toub <stoub@microsoft.com>
This commit is contained in:
parent
45dcfe07ca
commit
e3aa54eb3c
1 changed files with 155 additions and 75 deletions
|
|
@ -19,10 +19,8 @@ public static class McpJsonUtilitiesTests
|
|||
public static void DefaultOptions_UseReflectionWhenEnabled()
|
||||
{
|
||||
var options = McpJsonUtilities.DefaultOptions;
|
||||
bool isReflectionEnabled = JsonSerializer.IsReflectionEnabledByDefault;
|
||||
Type anonType = new { Id = 42 }.GetType();
|
||||
|
||||
Assert.True(isReflectionEnabled); // To be disabled once https://github.com/dotnet/extensions/pull/6241 is incorporated
|
||||
Assert.Equal(isReflectionEnabled, options.TryGetTypeInfo(anonType, out _));
|
||||
Assert.Equal(JsonSerializer.IsReflectionEnabledByDefault, options.TryGetTypeInfo(anonType, out _));
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue