package com.grayben.riskExtractor.headingMarker.elector;

import com.grayben.riskExtractor.headingMarker.TextCandidate;
import org.junit.After;
import org.junit.Before;
import org.junit.Ignore;
import org.junit.Test;
import org.mockito.Mock;
import org.mockito.Mockito;

import java.util.List;

import static org.junit.Assert.*;

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

    ElectedTextList electedTextList;

    @Mock
    protected List<String> stringListMock;

    @Mock
    protected List<TextCandidate> nomineesMock;

    @Mock
    protected List<TextCandidate> electeesMock;

    @Before
    public void setUp() throws Exception {
        electedTextList = new ElectedTextList(stringListMock, nomineesMock, electeesMock);
    }

    @After
    public void tearDown() throws Exception {

    }

    @Test
    public void test_GetNominees_ReturnsNonNull_Always() throws Exception {
        //setup data

        //setup expectations

        //exercise
        List<TextCandidate> nominees = electedTextList.getNominees();
        //verify
        assertNotNull(nominees);
    }

    @Test
    public void test_GetNominees_ReturnsConstructedNominees_OnlyWhenNoOverwrite() throws Exception {
        //setup data
        List<TextCandidate> newNomineesMock = (List<TextCandidate>) Mockito.mock(List.class);

        //setup expectations

        //exercise
        List<TextCandidate> nomineesReturned = electedTextList.getNominees();
        electedTextList.setNominees(newNomineesMock);
        List<TextCandidate> newNomineesReturned = electedTextList.getNominees();

        //verify
        assertEquals(nomineesMock, nomineesReturned);
        assertEquals(newNomineesMock, newNomineesReturned);
        assertNotEquals(nomineesMock, newNomineesReturned);
    }

    @Test
    public void test_GetElectees_ReturnsNonNull() throws Exception {
        //setup data

        //setup expectations

        //exercise

        //verify
    }
}
@@ -210,16 +210,49 @@
 t.Test;%0A
+import org.junit.runner.RunWith;%0A
 import o
@@ -287,23 +287,42 @@
 mockito.
-Mockito
+runners.MockitoJUnitRunner
 ;%0A%0Aimpor
@@ -373,16 +373,53 @@
 ssert.*;
+%0Aimport static org.mockito.Mockito.*;
 %0A%0A/**%0A *
@@ -454,16 +454,51 @@
 15.%0A */%0A
+@RunWith(MockitoJUnitRunner.class)%0A
 public c
@@ -1437,24 +1437,16 @@
 idate%3E) 
-Mockito.
 mock(Lis
@@ -1974,16 +1974,23 @@
 sNonNull
+_Always
 () throw
@@ -2074,33 +2074,815 @@
 xercise%0A
-%0A        //verify
+        List%3CTextCandidate%3E electees = electedTextList.getElectees();%0A        //verify%0A        assertNotNull(electees);%0A    %7D%0A%0A    @Test%0A    public void test_GetElectees_ReturnsConstructedElectees_OnlyWhenNoOverwrite() throws Exception %7B%0A        //setup data%0A        List%3CTextCandidate%3E newElecteesMock = (List%3CTextCandidate%3E) mock(List.class);%0A%0A        //setup expectations%0A%0A        //exercise%0A        List%3CTextCandidate%3E electeesReturned = electedTextList.getElectees();%0A        electedTextList.setElectees(newElecteesMock);%0A        List%3CTextCandidate%3E newElecteesReturned = electedTextList.getElectees();%0A%0A        //verify%0A        assertEquals(electeesMock, electeesReturned);%0A        assertEquals(newElecteesMock, newElecteesReturned);%0A        assertNotEquals(electeesMock, newElecteesReturned);
 %0A    %7D%0A%7D

Write tests