Add empty arrays to xml
This commit is contained in:
1 parent
9e4a14985e
commit
2385f672d0
3 files changed
+20
-1
No files matched your search
@@ -301,6 +301,11 @@ namespace VocaluxeTests
|
||||
<I>2</I>
|
||||
<J>3</J>
|
||||
</root>";
|
||||
private const string _XmlListEmb4 = _Head + @"<root>
|
||||
<I>2</I>
|
||||
<Entry />
|
||||
<J>3</J>
|
||||
</root>";
|
||||
|
||||
[TestMethod]
|
||||
public void TestListEmbedded()
|
||||
@@ -321,6 +326,10 @@ namespace VocaluxeTests
|
||||
Assert.AreEqual(foo.Ints.Count, 0, "Deserialization failed");
|
||||
res = ser.Serialize(foo);
|
||||
Assert.AreEqual(_XmlListEmb3, res, "Serialization failed");
|
||||
ser = new CXmlSerializer(true);
|
||||
foo.Ints.Clear();
|
||||
res = ser.Serialize(foo);
|
||||
Assert.AreEqual(_XmlListEmb4, res, "Serialization failed");
|
||||
_AssertFail<SListEmb, CXmlException>(_Empty);
|
||||
}
|
||||
|
||||
@@ -343,6 +352,10 @@ namespace VocaluxeTests
|
||||
Assert.AreEqual(foo.Ints.Length, 0, "Deserialization failed");
|
||||
res = ser.Serialize(foo);
|
||||
Assert.AreEqual(_XmlListEmb3, res, "Serialization failed");
|
||||
ser = new CXmlSerializer(true);
|
||||
foo.Ints = new SEntry[0];
|
||||
res = ser.Serialize(foo);
|
||||
Assert.AreEqual(_XmlListEmb4, res, "Serialization failed");
|
||||
_AssertFail<SArrayEmb, CXmlException>(_Empty);
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user