예제 #1
0
        public void SelfClosing()
        {
            var builder = new HTMLBuilder(HTMLDocumentType.HTML5);

            builder.Settings.EnforceProperNesting = true;
            builder.Empty();
            builder.AddElement("br", "");
            Assert.AreEqual(ConvertResourceStringToCurrentEnvironment(Test.Resources.AssertSelfClosing), builder.ToString());
        }
예제 #2
0
        public void NoSelfClosing()
        {
            var builder = new HTMLBuilder();

            builder.Settings.EnforceProperNesting = false;
            builder.Empty();
            builder.AddElement("script", new[] { new HTMLAttribute("src", "test.js") }, "");
            Assert.AreEqual(ConvertResourceStringToCurrentEnvironment(Test.Resources.AssertNoSelfClosing), builder.ToString());
        }