package com.grayben.riskExtractor.htmlScorer.partScorers.elementScorers;

import com.grayben.riskExtractor.htmlScorer.partScorers.ScorerTest;
import com.grayben.riskExtractor.htmlScorer.partScorers.tagScorers.TagEmphasisScorer;
import org.jsoup.nodes.Element;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.Mock;
import org.mockito.runners.MockitoJUnitRunner;

import static junit.framework.Assert.assertEquals;
import static junit.framework.TestCase.fail;

/**
 * Created by beng on 28/11/2015.
 */
@RunWith(MockitoJUnitRunner.class)
public class SegmentationElementScorerTest
        extends ScorerTest<Element> {

    SegmentationElementScorer elementScorerSUT;

    @Mock
    public Element elementToBeScoredMock;

    @Before
    public void setUp() throws Exception {
        TagEmphasisScorer tagScorer
                = new TagEmphasisScorer(TagEmphasisScorer.defaultMap());
        elementScorerSUT = new SegmentationElementScorer(tagScorer);
        super.setScorerSUT(elementScorerSUT);
        super.setArgumentToBeScoredMock(elementToBeScoredMock);
        super.setUp();
    }

    @After
    public void tearDown() throws Exception {
        elementScorerSUT = null;
        super.tearDown();
    }

    @Override
    @Test
    public void
    test_ScoreReturnsInteger_WhenArgumentIsNotEmpty() throws Exception {
        Integer returned = elementScorerSUT.score(elementToBeScoredMock);

        assertEquals(Integer.class, returned.getClass());
    }

    @Override
    @Test
    public void
    test_ScoreGivesExpectedResult_WhenSimpleInput() throws Exception {
        fail("Test not implemented");
    }

    @Test
    public void
    test_ScoreThrowsIllegalArgumentException_WhenEmptyInput() throws Exception {
        fail("Test not implemented: decide whether appropriate");
    }

}
@@ -244,23 +244,87 @@
 p.nodes.
-Element
+Attributes;%0Aimport org.jsoup.nodes.Element;%0Aimport org.jsoup.parser.Tag
 ;%0Aimport
@@ -426,33 +426,8 @@
 th;%0A
-import org.mockito.Mock;%0A
 impo
@@ -470,16 +470,93 @@
 unner;%0A%0A
+import static com.grayben.riskExtractor.htmlScorer.partScorers.TestHelper.*;%0A
 import s
@@ -856,18 +856,8 @@
 T;%0A%0A
-    @Mock%0A
     
@@ -1423,32 +1423,32 @@
     public void%0A
-
     test_ScoreRe
@@ -1496,32 +1496,211 @@
 ows Exception %7B%0A
+        Tag tagStub = stubTag(%22a-tag-name%22);%0A        Attributes attributeStubs = dummyAttributes();%0A        elementToBeScoredMock = stubElement(tagStub, attributeStubs);%0A        %0A
         Integer 

Implement test