package htmlflow.test;

import htmlflow.HtmlView;
import org.junit.Test;

import java.io.*;

/**
 * Created by mcarvalho on 18-01-2016.
 */
public class TestDivDetails {
    @Test
    public void test_div_details_without_binding() throws IOException {
        HtmlView<?> taskView = new HtmlView<>();
        taskView
                .head()
                .title("Task Details")
                .linkCss("https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css");
        taskView
                .body().classAttr("container")
                .heading(1, "Task Details")
                .hr()
                .div()
                .text("Title: ").text("ISEL MPD project")
                .br()
                .text("Description: ").text("A Java library for serializing objects in HTML.")
                .br()
                .text("Priority: ").text("HIGH");
        //
        // Produces an HTML file document
        //
        ByteArrayOutputStream mem = new ByteArrayOutputStream();
        try(PrintStream out = new PrintStream(mem)){
            taskView.setPrintStream(out).write();
            System.out.println(mem.toString());
        }
    }
}

@@ -54,24 +54,304 @@
 ort 
-org.junit.Test;%0A
+htmlflow.attribute.AttributeType;%0Aimport htmlflow.elements.ElementType;%0Aimport junit.framework.Assert;%0Aimport org.junit.Test;%0Aimport org.w3c.dom.Element;%0Aimport org.w3c.dom.Node;%0Aimport org.w3c.dom.NodeList;%0Aimport org.xml.sax.SAXException;%0A%0Aimport javax.xml.parsers.ParserConfigurationException;
 %0Aimp
@@ -522,16 +522,60 @@
 xception
+, ParserConfigurationException, SAXException
  %7B%0A     
@@ -1440,16 +1440,19 @@
         
+ //
  System.
@@ -1490,16 +1490,942 @@
       %7D%0A
+        /*%0A%09%09 * Assert HTML document main structure%0A%09%09 */%0A        Element elem = DomUtils.getRootElement(mem.toByteArray());%0A        Assert.assertEquals(ElementType.HTML.toString(), elem.getNodeName());%0A        NodeList childNodes = elem.getChildNodes();%0A        Node head = childNodes.item(1);%0A        Assert.assertEquals(ElementType.HEAD.toString(), head.getNodeName());%0A        Node body = childNodes.item(3);%0A        Assert.assertEquals(ElementType.BODY.toString(), body.getNodeName());%0A        Node bodyClassAttr = body.getAttributes().getNamedItem(AttributeType.CLASS.toString());%0A        Assert.assertEquals(%22container%22, bodyClassAttr.getNodeValue());%0A        /*%0A%09%09 * Assert HTML Head%0A%09%09 */%0A        childNodes = head.getChildNodes();%0A        Assert.assertEquals(ElementType.TITLE.toString(), childNodes.item(1).getNodeName());%0A        Assert.assertEquals(ElementType.LINK.toString(), childNodes.item(3).getNodeName());%0A
     %7D%0A%7D%0A

Add Assert to TestDivDetails::test_div_details_without_binding()