public void EncodeWithDynamicObject() { // Arrange dynamic obj = new DummyDynamicObject(); obj.Name = "Hello"; obj.Age = 1; obj.Grades = new[] { "A", "B", "C" }; // Act string json = Json.Encode(obj); // Assert Assert.AreEqual("{\"Name\":\"Hello\",\"Age\":1,\"Grades\":[\"A\",\"B\",\"C\"]}", json); }
public void EncodeWithDynamicObject() { // Arrange dynamic obj = new DummyDynamicObject(); obj.Name = "Hello"; obj.Age = 1; obj.Grades = new[] { "A", "B", "C" }; // Act string json = Json.Encode(obj); // Assert Assert.Equal("{\"Name\":\"Hello\",\"Age\":1,\"Grades\":[\"A\",\"B\",\"C\"]}", json); }