Skip to content

Commit 2181572

Browse files
Potential fix for pull request finding
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
1 parent 249721b commit 2181572

1 file changed

Lines changed: 1 addition & 3 deletions

File tree

src/libraries/System.Text.Json/tests/Common/PropertyVisibilityTests.NonPublicAccessors.cs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -365,9 +365,7 @@ public virtual async Task NonPublicProperty_JsonInclude_WorksAsExpected(Type typ
365365
string json = """{"MyString":"value"}""";
366366
MemberInfo memberInfo = type.GetMember("MyString", BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance)[0];
367367

368-
object result = await Serializer.DeserializeWrapper("""{"MyString":"value"}""", type);
369-
Assert.IsType(type, result);
370-
Assert.Equal(memberInfo is PropertyInfo p ? p.GetValue(result) : ((FieldInfo)memberInfo).GetValue(result), "value");
368+
Assert.Equal("value", memberInfo is PropertyInfo p ? p.GetValue(result) : ((FieldInfo)memberInfo).GetValue(result));
371369

372370
string actualJson = await Serializer.SerializeWrapper(result, type);
373371
Assert.Equal(json, actualJson);

0 commit comments

Comments
 (0)