public void Flatten() { string xml = "<root>" + "\r\n" + " <parent a='123'>blah " + "\r\n" + " blah</parent>" + "\n" + // simulate inconsistent new lines. " <parent " + "\r\n" + " b='456'><child>" + "\r\n" + " abcefg" + "\r\n" + " </child></parent>" + "\r\n" + " </root>"; string flat = FormatHtmlHelper.Flatten(xml); Assert.AreEqual("<root><parent a='123'>blah blah</parent><parent b='456'><child>abcefg</child></parent></root>", flat); // Semantics should be unchanged. }
public void Flatten_null_string() { string flat = FormatHtmlHelper.Flatten(null); Assert.IsEmpty(flat); }