Uploaded image for project: 'Couchbase .NET client library'
  1. Couchbase .NET client library
  2. NCBC-2042

JSON.NET uses Pascal casing instead of Camel casing on Ubuntu16

    XMLWordPrintable

Details

    • 1

    Description

      It seems like on some platforms (at least Ubuntu16), the default ContractResolver for JsonConvert is the PascalCasePropertyNamesContractProvider DefaultContractResolver; this causes some tests to fail if they compare the JSON string:

      Failed Couchbase.UnitTests.Services.Search.FtsDataMapperTests.Facets_Are_Populated_When_Result_Contains_Facets
      Error Message:
      Assert.Equal() Failure
      ↓ (pos 178)
      Expected: ···{"numericRanges":[{"Name":"numeric1","Min":0.1,"Max":0.2,"Cou···
      Actual: ···{"numericRanges":[{"name":"numeric1","min":0.1,"max":0.2,"cou···
      ↑ (pos 178)
      Stack Trace:
      at Couchbase.UnitTests.Services.Search.FtsDataMapperTests.Facets_Are_Populated_When_Result_Contains_Facets() in /home/couchbase/jenkins/workspace/dotnet/couchbase-net-client-scripted-build-pipeline/couchbase-net-client/tests/Couchbase.UnitTests/Services/Search/SearchDataMapperTests.cs:line 180
      {"ctl":{"timeout":10000,"consistency":{"level":"at_plus","vectors":{}}},"size":10,"from":20,"explain":true}
      {"ctl":{"timeout":10000,"consistency":{"level":"at_plus","vectors":{}}},"size":10,"from":20,"explain":true}
      {"ctl":

      {"timeout":75000}

      ,"facets":{"termfacet":

      {"field":"thefield","size":10}

      ,"daterangefacet":{"field":"thefield","size":10,"date_ranges":[

      {"name":null,"start":"2019-07-24T21:59:31.9295867+00:00","end":"2019-07-25T21:59:31.9295885+00:00"}

      ]},"numericrangefacet":{"field":"thefield","size":2,"numeric_ranges":[

      {"name":null,"min":2.2,"max":3.5}

      ]}}}

      Attachments

        Activity

          People

            jmorris Jeff Morris
            jmorris Jeff Morris
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              PagerDuty