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

import com.grayben.riskExtractor.htmlScorer.partScorers.TagAndAttribute;
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.TestCase.fail;

/**
 * Created by beng on 28/11/2015.
 */
@RunWith(MockitoJUnitRunner.class)
public class TagAndAttributeScorerTest
        extends MapScorerTest<TagAndAttribute> {

    TagAndAttributeScorer tagAndAttributeSUT;

    @Mock
    public TagAndAttribute tagAndAttributeToBeScoredMock;

    @Before
    public void setUp() throws Exception {
        tagAndAttributeSUT = new TagAndAttributeScorer(
                TagAndAttributeScorer.defaultMap()
        );
        super.setArgumentToBeScoredMock(tagAndAttributeToBeScoredMock);
        super.setMapScorerSUT(tagAndAttributeSUT);
        super.setUp();
    }

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

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

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

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

    @Test
    public void
    test_ScoreThrowsIllegalArgumentException_WhenEmptyInput() throws Exception {
        fail("Test not implemented: decide whether appropriate");
    }
}
@@ -136,16 +136,79 @@
 ribute;%0A
+import org.jsoup.nodes.Attribute;%0Aimport org.jsoup.parser.Tag;%0A
 import o
@@ -329,16 +329,44 @@
 o.Mock;%0A
+import org.mockito.Mockito;%0A
 import o
@@ -405,16 +405,91 @@
 unner;%0A%0A
+import java.util.Map;%0A%0Aimport static junit.framework.Assert.assertNotNull;%0A
 import s
@@ -734,16 +734,22 @@
 tributeS
+corerS
 UT;%0A%0A   
@@ -893,16 +893,22 @@
 tributeS
+corerS
 UT = new
@@ -1111,16 +1111,22 @@
 tributeS
+corerS
 UT);%0A   
@@ -1360,179 +1360,1068 @@
     
-fail(%22Test not implemented%22);%0A    %7D%0A%0A    @Override%0A    public void test_ScoreReturnsInteger_WhenArgumentIsNotEmpty() throws Exception %7B%0A        fail(%22Test not implemented%22
+Map%3CTagAndAttribute, Integer%3E nullMap = null;%0A%0A        thrown.expect(NullPointerException.class);%0A%0A        tagAndAttributeScorerSUT = new TagAndAttributeScorer(nullMap);%0A    %7D%0A%0A    @Override%0A    public void test_ScoreReturnsInteger_WhenArgumentIsNotEmpty() throws Exception %7B%0A        Tag tagMock = Mockito.mock(Tag.class);%0A        Mockito.when(tagMock.getName()).thenReturn(%22font%22);%0A        Mockito.when(tagMock.isEmpty()).thenReturn(false);%0A%0A        Attribute attributeMock = Mockito.mock(Attribute.class);%0A        Mockito.when(attributeMock.getKey()).thenReturn(%22foo%22);%0A        Mockito.when(attributeMock.getValue()).thenReturn(%22bar%22);%0A        Mockito.when(attributeMock.html()).thenReturn(%22%3Cfoo%3Ebar%3C/foo%3E%22);%0A%0A        Mockito.when(tagAndAttributeToBeScoredMock.getAttribute())%0A                .thenReturn(attributeMock);%0A        Mockito.when(tagAndAttributeToBeScoredMock.getTag())%0A                .thenReturn(tagMock);%0A%0A        Integer returned%0A                = tagAndAttributeScorerSUT.score(tagAndAttributeToBeScoredMock);%0A%0A        assertNotNull(returned
 );%0A 

Implement some tests