Add better validation for JsonCommentHandling enum and re-order the values. (dotnet...
authorAhson Khan <ahkha@microsoft.com>
Tue, 25 Jun 2019 21:14:47 +0000 (14:14 -0700)
committermsftbot[bot] <48340428+msftbot[bot]@users.noreply.github.com>
Tue, 25 Jun 2019 21:14:47 +0000 (21:14 +0000)
commit6348741a686f5d3e239ab4b513bceb869abbd555
treee8b1ecf964632c1aa80f6891539cd33bd2c3fa66
parent75295ee15771d6677bebe9f3bd282be669932246
Add better validation for JsonCommentHandling enum and re-order the values. (dotnet/corefx#38622)

* Add validation for JsonCommentHandling enum.

* Address PR feedback.

* Fix typos and make the checks consistent.

* Add parameter name to the argument OOR exception and update tests.

Commit migrated from https://github.com/dotnet/corefx/commit/0691e5ffc5b569730688f0a61aa63555db2b1e47
src/libraries/System.Text.Json/ref/System.Text.Json.cs
src/libraries/System.Text.Json/src/Resources/Strings.resx
src/libraries/System.Text.Json/src/System/Text/Json/Document/JsonDocument.cs
src/libraries/System.Text.Json/src/System/Text/Json/JsonCommentHandling.cs
src/libraries/System.Text.Json/src/System/Text/Json/Reader/JsonReaderOptions.cs
src/libraries/System.Text.Json/src/System/Text/Json/Serialization/JsonSerializerOptions.cs
src/libraries/System.Text.Json/src/System/Text/Json/ThrowHelper.cs
src/libraries/System.Text.Json/tests/JsonReaderStateAndOptionsTests.cs
src/libraries/System.Text.Json/tests/Serialization/OptionsTests.cs