public void WriteImmutableSortedDictionaryOfInt32() { ImmutableSortedDictionary <int, int> value = ImmutableSortedDictionary.CreateRange(new SortedDictionary <int, int> { { 1, 1 }, { 2, 2 }, { 3, 3 } }); const string expected = @"{""1"":1,""2"":2,""3"":3}"; JsonSerializerOptions options = new JsonSerializerOptions(); options.SetupExtensions(); string actual = JsonSerializer.Serialize(value, value.GetType(), options); Assert.Equal(expected, actual); }