package com.grayben.riskExtractor.htmlScorer;

import org.junit.*;
import org.junit.rules.ExpectedException;
import org.junit.runner.RunWith;
import org.mockito.Mock;
import org.mockito.runners.MockitoJUnitRunner;

import java.util.Map;

import static org.jsoup.helper.Validate.fail;
import static org.junit.Assert.*;

/**
 * Created by beng on 28/11/2015.
 */
@Ignore
@RunWith(MockitoJUnitRunner.class)
public class ScoredTextElementTest {

    ScoredTextElement scoredTextElementSUT;

    @Mock
    Map<String, Integer> scoresMock;

    String textElementArgument;

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

    @Before
    public void setUp() throws Exception {
        textElementArgument = "foo";
        scoredTextElementSUT = new ScoredTextElement(textElementArgument, scoresMock);
    }

    @After
    public void tearDown() throws Exception {

    }

    @Test
    public void
    test_InitThrowsNullPointerException_WhenTextElementArgumentIsNull
            () throws Exception {
        thrown.expect(NullPointerException.class);

        new ScoredTextElement(null, scoresMock);
    }

    @Test
    public void
    test_InitThrowsNullPointerException_WhenScoresMapIsNull
            () throws Exception {
        thrown.expect(NullPointerException.class);

        new ScoredTextElement(textElementArgument, null);
    }

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

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

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

    @Test
    public void test_GetTextElement_IsNotNull_Always
            () throws Exception {
        String textElementReturned = scoredTextElementSUT.getTextElement();

        assertNotNull(textElementReturned);
    }

    @Test
    public void test_GetScores_IsNotNull_Always
            () throws Exception {
        Map<String, Integer> scoresReturned = scoredTextElementSUT.getScores();

        assertNotNull(scoresReturned);
    }

    @Test
    public void testGetTextElement_ReturnsMockedScores_Always() throws Exception {
        Map scoresReturned = scoredTextElementSUT.getScores();

        assertEquals(scoresMock, scoresReturned);
    }

    @Test
    public void testGetTextElement_ReturnsMockedTextElement_Always() throws Exception {
        String textElementReturned;
        textElementReturned = scoredTextElementSUT.getTextElement();

        assertEquals(textElementArgument, textElementReturned);
    }
}
@@ -139,33 +139,8 @@
 th;%0A
-import org.mockito.Mock;%0A
 impo
@@ -204,59 +204,39 @@
 til.
+Hash
 Map;%0A
-%0A
 import 
-static org.jsoup.helper.Validate.fail;
+java.util.Map;%0A
 %0Aimp
@@ -313,16 +313,8 @@
  */%0A
-@Ignore%0A
 @Run
@@ -431,18 +431,8 @@
 T;%0A%0A
-    @Mock%0A
     
@@ -459,19 +459,26 @@
  scoresM
-ock
+apArgument
 ;%0A%0A    S
@@ -627,32 +627,77 @@
 ows Exception %7B%0A
+        scoresMapArgument = new HashMap%3C%3E();%0A
         textElem
@@ -790,35 +790,42 @@
 rgument, scoresM
-ock
+apArgument
 );%0A    %7D%0A%0A    @A
@@ -1108,19 +1108,26 @@
  scoresM
-ock
+apArgument
 );%0A    %7D
@@ -2516,19 +2516,26 @@
 (scoresM
-ock
+apArgument
 , scores

Remove @Ignore, @Mock