public static void WritePrimitiveIImmutableSetT() { IImmutableSet <int> input = ImmutableHashSet.CreateRange(new List <int> { 1, 2 }); string json = JsonSerializer.Serialize(input); Assert.Equal("[1,2]", json); StringIImmutableSetWrapper input2 = new StringIImmutableSetWrapper(new List <string> { "1", "2" }); json = JsonSerializer.Serialize(input2); Assert.True(json == @"[""1"",""2""]" || json == @"[""2"",""1""]"); }
// Call only when testing serialization. public void Initialize() { MyStringIImmutableSetWrapper = new StringIImmutableSetWrapper(new List <string> { "Hello" }); }