Esempio n. 1
0
        public void VerifyFormatElementWithLotsOfAttributes()
        {
            string          originalText = @"<foo a='very big string1' b='very big string2' c='very big string3' d='very big string4'></foo>";
            MarkupFormatter formatter    = new MarkupFormatter();
            string          newText      = formatter.Format(originalText);

            string expectedText = "<foo a='very big string1' b='very big string2' c='very big string3'\n\t d='very big string4'></foo>\n";

            UnitTestAssert.AreEqual(expectedText, newText, newText);
        }
Esempio n. 2
0
        public void VerifyFormatMultipleTopLevelElements()
        {
            string          originalText = @"<a></a><b></b>";
            MarkupFormatter formatter    = new MarkupFormatter();
            string          newText      = formatter.Format(originalText);

            string expectedText = @"<a></a>
<b></b>
";

            UnitTestAssert.AreEqual(expectedText.Replace("\r", ""), newText, newText);
        }
Esempio n. 3
0
        public void VerifyFormatElementWithInnerText()
        {
            string          originalText = @"<a><b>Very Long StringVery Long StringVery Long StringVery Long StringVery Long StringVery Long StringVery Long StringVery Long StringVery Long StringVery Long String</b></a>";
            MarkupFormatter formatter    = new MarkupFormatter();
            string          newText      = formatter.Format(originalText);

            string expectedText = @"<a>
	<b>
		Very Long StringVery Long StringVery Long StringVery Long StringVery Long StringVery Long StringVery Long StringVery Long StringVery Long StringVery Long StringTOKEN
	</b>
</a>
";

            expectedText = expectedText.Replace("\r", "").Replace("TOKEN", "\r");

            UnitTestAssert.AreEqual(expectedText, newText, newText);
        }
Esempio n. 4
0
        public void VerifyFormatElementWithLotsOfNestedElements()
        {
            string          originalText = @"<a><b><c><d></d></c></b></a>";
            MarkupFormatter formatter    = new MarkupFormatter();
            string          newText      = formatter.Format(originalText);

            string expectedText = @"<a>
	<b>
		<c>
			<d></d>
		</c>
	</b>
</a>
";

            UnitTestAssert.AreEqual(expectedText.Replace("\r", ""), newText, newText);
        }