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

Commit 607bc95

Browse files
committed
Added ICollection test
Also added extra Assert in IEnumerable test
1 parent b55fad6 commit 607bc95

File tree

1 file changed

+22
-1
lines changed

1 file changed

+22
-1
lines changed

tests/ServiceStack.Text.Tests/AdhocModelTests.cs

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
using System.Globalization;
66
using System.Runtime.Serialization;
77
using System.Threading;
8+
using System.Xml;
89
using NUnit.Framework;
910
using ServiceStack.Common.Extensions;
1011
using ServiceStack.Text.Jsv;
@@ -710,9 +711,29 @@ public void Can_serialize_IEnumerable()
710711
};
711712

712713
var from = Serialize(dto, includeXml: false);
714+
Assert.IsNotNull(from.Blah);
713715
from.PrintDump();
714716
}
715-
717+
718+
public class BreakerCollection
719+
{
720+
public ICollection Blah { get; set; }
721+
}
722+
723+
[Test]
724+
public void Can_serialize_ICollection()
725+
{
726+
var dto = new BreakerCollection
727+
{
728+
Blah = new List<int> { 1, 2, 3, 4, 5, 6, 7, 8, 9 }
729+
};
730+
731+
var from = Serialize(dto, includeXml: false);
732+
Assert.IsNotNull(from.Blah);
733+
Assert.AreEqual(dto.Blah.Count, from.Blah.Count);
734+
from.PrintDump();
735+
}
736+
716737
public class XmlAny
717738
{
718739
public XmlElement[] Any { get; set; }

0 commit comments

Comments
 (0)