package com.grayben.riskExtractor.htmlScorer.nodeVisitor;

import org.jsoup.select.NodeVisitor;
import org.junit.*;
import org.junit.rules.ExpectedException;
import org.junit.runner.RunWith;
import org.mockito.runners.MockitoJUnitRunner;

import static org.junit.Assert.fail;

/**
 * Created by beng on 16/12/2015.
 */
@RunWith(MockitoJUnitRunner.class)
public abstract class NodeVisitorTest {

    private NodeVisitor nodeVisitorSUT;

    protected void setNodeVisitorSUT(NodeVisitor nodeVisitorSUT) {
        this.nodeVisitorSUT = nodeVisitorSUT;
    }

    @Rule
    public ExpectedException thrown = ExpectedException.none();

    @Before
    public void setUp() throws Exception {

    }

    @After
    public void tearDown() throws Exception {

    }

    @Ignore
    @Test
    public void
    test_HeadThrowsNullPointerException_WhenNodeIsNull
            () throws Exception {
        fail("Test not implemented");
    }

    @Ignore
    @Test
    public void
    test_HeadThrowsIllegalArgumentException_WhenDepthBelowZero
            () throws Exception {
        fail("Test not implemented");
    }

    @Ignore
    @Test
    public void
    test_TailThrowsNullPointerException_WhenNodeIsNull
            () throws Exception {
        fail("Test not implemented");
    }

    @Ignore
    @Test
    public void
    test_TailThrowsIllegalArgumentException_WhenDepthBelowZero
            () throws Exception {
        fail("Test not implemented");
    }
}

@@ -73,46 +73,182 @@
 oup.
-select.NodeVisitor;%0Aimport org.junit.*
+nodes.Comment;%0Aimport org.jsoup.nodes.Node;%0Aimport org.jsoup.select.NodeVisitor;%0Aimport org.junit.After;%0Aimport org.junit.Before;%0Aimport org.junit.Rule;%0Aimport org.junit.Test
 ;%0Aim
@@ -372,46 +372,8 @@
 r;%0A%0A
-import static org.junit.Assert.fail;%0A%0A
 /**%0A
@@ -846,36 +846,24 @@
 n %7B%0A%0A    %7D%0A%0A
-    @Ignore%0A
     @Test%0A  
@@ -977,56 +977,131 @@
     
-fail(%22Test not implemented%22
+thrown.expect(NullPointerException.class
 );%0A
+%0A 
     
-%7D%0A%0A    @Ignore
+   Node nullNode = null;%0A%0A        nodeVisitorSUT.head(nullNode, 1);%0A    %7D%0A
 %0A   
@@ -1232,56 +1232,219 @@
     
-fail(%22Test not implemented
+thrown.expect(IllegalArgumentException.class);%0A%0A        Node node = new Comment(%22a comment here%22, %22a base URI there
 %22);%0A
+%0A  
     
-%7D%0A%0A    @Ignore
+  int depthBelowZero = -1;%0A%0A        nodeVisitorSUT.head(node, depthBelowZero);%0A    %7D%0A
 %0A   
@@ -1567,56 +1567,131 @@
     
-fail(%22Test not implemented%22
+thrown.expect(NullPointerException.class
 );%0A
+%0A
     
-%7D%0A%0A    @Ignore
+    Node nullNode = null;%0A%0A        nodeVisitorSUT.tail(nullNode, 1);%0A    %7D%0A
 %0A   
@@ -1822,35 +1822,210 @@
     
-fail(%22Test not implemented%22
+thrown.expect(IllegalArgumentException.class);%0A%0A        Node node = new Comment(%22a comment here%22, %22a base URI there%22);%0A%0A        int depthBelowZero = -1;%0A%0A        nodeVisitorSUT.tail(node, depthBelowZero
 );%0A 

Add four exception tests