Skip to content
This repository was archived by the owner on Dec 5, 2024. It is now read-only.

Commit f97eaad

Browse files
committed
Add test for SimpleJson List deserialization bug
1 parent 403298c commit f97eaad

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

src/tests/UnitTests/Primitives/SerializationTests.cs

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,5 +30,20 @@ public void DateTimeSerializationRoundTrip()
3030
Assert.AreEqual(dt1, dt2);
3131
Assert.AreEqual(dt2, dt3);
3232
}
33+
34+
class TestData
35+
{
36+
public List<string> Things { get; set; } = new List<string>();
37+
}
38+
39+
[Test]
40+
public void ListDeserializesCorrectly()
41+
{
42+
var data = new TestData();
43+
data.Things.Add("something");
44+
var json = data.ToJson();
45+
var ret = json.FromJson<TestData>();
46+
CollectionAssert.AreEquivalent(data.Things, ret.Things);
47+
}
3348
}
3449
}

0 commit comments

Comments
 (0)