package com.grayben.riskExtractor.htmlScorer;

import org.junit.After;
import org.junit.Before;
import org.junit.Ignore;
import org.junit.Test;
import org.mockito.Mock;

import java.util.Map;

import static org.junit.Assert.*;

/**
 * Created by beng on 28/11/2015.
 */
public class ScoredTextElementTest {

    ScoredTextElement scoredTextElementSUT;

    @Mock
    Map<String, Integer> scoresMock;

    @Mock
    String textElementMock;

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

    @After
    public void tearDown() throws Exception {

    }

    @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(textElementMock, textElementReturned);

    }

    @Ignore
    @Test
    public void testGetScores() throws Exception {

    }
}
@@ -57,21 +57,17 @@
 g.junit.
-After
+*
 ;%0Aimport
@@ -81,62 +81,31 @@
 nit.
-Before;%0Aimport org.junit.Ignore;%0Aimport org.junit.Test
+rules.ExpectedException
 ;%0Aim
@@ -394,24 +394,99 @@
 ementMock;%0A%0A
+    @Rule%0A    public ExpectedException thrown = ExpectedException.none();%0A%0A
     @Before%0A
@@ -675,32 +675,503 @@
 ption %7B%0A%0A    %7D%0A%0A
+    @Test%0A    public void%0A    test_InitThrowsNullPointerException_WhenTextElementArgumentIsNull%0A            () throws Exception %7B%0A        thrown.expect(NullPointerException.class);%0A%0A        new ScoredTextElement(null, scoresMock);%0A    %7D%0A%0A    @Test%0A    public void%0A    test_InitThrowsNullPointerException_WhenScoresMapIsNull%0A            () throws Exception %7B%0A        thrown.expect(NullPointerException.class);%0A%0A        new ScoredTextElement(textElementMock, null);%0A    %7D%0A%0A
     @Test%0A    pu

Add tests for passing null to constructor