Beispiel #1
0
        public void HtmlTest()
        {
            var           line             = new JavaScriptOperation(TEST_TEXT);
            var           head             = new HtmlHead();
            PrivateObject headObj          = new PrivateObject(head);
            var           expectedHtmlCode = String.Format("{0}{1}", headObj.GetField("_required", BindingFlags.NonPublic | BindingFlags.Static), line.HtmlCode);

            Assert.IsTrue(head.AddElement(line));
            Assert.AreEqual(head.Html, expectedHtmlCode);
        }
Beispiel #2
0
        public void AddElementTest()
        {
            var           line    = new JavaScriptOperation(TEST_TEXT);
            var           head    = new HtmlHead();
            PrivateObject headObj = new PrivateObject(head);

            Assert.IsTrue(head.AddElement(line));
            var collection = headObj.GetField("_children") as IList <IHtmlElement>;

            Assert.IsNotNull(collection);
            Assert.IsTrue(collection.Contains(line));
            Assert.IsTrue(collection.Count == 1);
        }