-
-
Save MarcoDorantes/3f7712c22a2247f76e80cf2fef59a775 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System.Xml.Linq; | |
using Microsoft.VisualStudio.TestTools.UnitTesting; | |
public partial class ToXMLSpec | |
{ | |
[TestMethod] | |
public void from_maplist1() | |
{ | |
//Arrange | |
var yamltext = @"--- | |
a: | |
id: 1 | |
keys: | |
- A | |
- B | |
..."; | |
var map = yaml.deserial(yamltext); | |
var expected_xmltext = | |
@"<yaml> | |
<map> | |
<entry> | |
<key>a</key> | |
<value> | |
<map> | |
<entry> | |
<key>id</key> | |
<value>1</value> | |
</entry> | |
<entry> | |
<key>keys</key> | |
<value> | |
<list> | |
<entry>A</entry> | |
<entry>B</entry> | |
</list> | |
</value> | |
</entry> | |
</map> | |
</value> | |
</entry> | |
</map> | |
</yaml>"; | |
//Act | |
var xml = XDocument.Parse(yaml.AsXml_1dot0(map)); | |
//Assert | |
Assert.AreEqual("yaml", xml.Root.Name); | |
Assert.AreEqual(expected_xmltext, $"{xml}"); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment