-
Notifications
You must be signed in to change notification settings - Fork 5.3k
Description
We can improve test coverage of certain branches within JsonElement (when it's backed by JsonNode):
| Metric | Value |
|---|---|
| Covered lines: | 629 |
| Uncovered lines: | 13 |
| Coverable lines: | 642 |
| Total lines: | 2096 |
| Line coverage: | 97.9% (629 of 642) |
| Covered branches: | 213 |
| Total branches: | 225 |
| Branch coverage: | 94.6% (213 of 225) |
Edge cases while enumerating JSON objects and JSON arrays. It's possible these branches are unreachable:
https://github.com/dotnet/corefx/blob/e8efb815275c8323fedc950ca3596474fa5e23c3/src/System.Text.Json/src/System/Text/Json/Document/JsonElement.ArrayEnumerator.cs#L51-L59

https://github.com/dotnet/corefx/blob/e8efb815275c8323fedc950ca3596474fa5e23c3/src/System.Text.Json/src/System/Text/Json/Document/JsonElement.ObjectEnumerator.cs#L47-L55

These tests won't fail on .NET Core (and they are likely already covered by tests that run on netfx, but it would be good to verify).
https://github.com/dotnet/corefx/blob/e8efb815275c8323fedc950ca3596474fa5e23c3/src/System.Text.Json/src/System/Text/Json/Document/JsonElement.cs#L1097-L1105

https://github.com/dotnet/corefx/blob/e8efb815275c8323fedc950ca3596474fa5e23c3/src/System.Text.Json/src/System/Text/Json/Document/JsonElement.cs#L1176-L1184

cc @kasiabulat