public void Can_Serialize() { var model = EdgeCaseProperties.Create(1); var s = JsonSerializer.SerializeToString(model); Console.WriteLine(s); }
public void Can_Deserialize() { const string json = "{\"id\":\"1\",\"1\":\"1\"}"; var model = EdgeCaseProperties.Create(1); var fromJson = JsonSerializer.DeserializeFromString <EdgeCaseProperties>(json); Assert.That(fromJson, Is.EqualTo(model)); }
public void Can_Serialize_map() { var model = new Dictionary <string, EdgeCaseProperties> { { "A", EdgeCaseProperties.Create(1) }, { "B", EdgeCaseProperties.Create(2) }, }; var s = JsonSerializer.SerializeToString(model); Console.WriteLine(s); }
public void Can_Serialize_list() { var model = new List <EdgeCaseProperties> { EdgeCaseProperties.Create(1), EdgeCaseProperties.Create(2) }; var s = JsonSerializer.SerializeToString(model); Console.WriteLine(s); }