Skip to content

Create new AssertContentsAgainstJsonNet to avoid calling NormalizeToJsonNetFormat when not necessary. #32351

Closed

Description

@ahsonkhan

There are subtle differences between Newtonsoft.Json and S.T.Json on how characters are escaped (upper case hex digits vs lower case), etc. This requires helpers for testing. Capturing the TODO into an issue: dotnet/corefx#39900 (comment).

// Temporary hack until we can use the same escape algorithm on both sides and make sure we want uppercase hex.
// Todo: create new AssertContentsAgainJsonNet to avoid calling NormalizeToJsonNetFormat when not necessary.
Assert.Equal(expectedValue.NormalizeToJsonNetFormat(), value.NormalizeToJsonNetFormat());

// Temporary hack until we can use the same escape algorithm on both sides and make sure we want uppercase hex.
// Todo: create new AssertContentsNotEqualAgainJsonNet to avoid calling NormalizeToJsonNetFormat when not necessary.
Assert.NotEqual(expectedValue.NormalizeToJsonNetFormat(), value.NormalizeToJsonNetFormat());

cc @steveharter

Activity

  1. added this to the 5.0 milestone on Feb 15, 2020
  2. added
    untriaged
    on Feb 15, 2020
  3. removed
    untriaged
    on Feb 15, 2020
  4. added
    help wanted
    on Apr 7, 2020
  5. added a commit that references this issue on Apr 14, 2020
    101bcd9
  6. added a commit that references this issue on Apr 15, 2020
    2eef5a3
  7. ghost locked as resolved and limited conversation to collaborators on Dec 10, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-System.Text.Jsonhelp wantedtest-enhancement

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions