package sparetime.teaching.exercises;

import org.junit.Before;
import org.junit.Test;

import java.util.ArrayList;
import java.util.List;

import static org.hamcrest.core.Is.is;
import static org.junit.Assert.assertThat;

/**
 * Created by Lukas on 01-11-2015.
 */
public class Exercise2Tests {
    private Exercise2 _exercise2_true;
    private Exercise2 _exercise2_false;

    @Before
    public void setUp() {
        _exercise2_true = new Exercise2(true);
        _exercise2_false = new Exercise2(false);
    }

    @Test
    public void shouldHaveTestVal1To5_WhenTrue() {
        assertThat(_exercise2_true.getTestVal1(), is(5));
    }

    @Test
    public void shouldHaveTestVal1To3_WhenFalse() {
        assertThat(_exercise2_false.getTestVal1(), is(3));
    }

    @Test
    public void shouldHaveTestVal2To4_WhenTrue() {
        assertThat(_exercise2_false.getTestVal2(), is(4));
    }

    @Test
    public void shouldHaveTestVal2To6_WhenFalse() {
        assertThat(_exercise2_false.getTestVal2(), is(6));
    }

    @Test
    public void shouldHaveTheCorrectList() {
        List<Integer> testList = new ArrayList<Integer>();
        testList.add(3);
        testList.add(1);
        testList.add(3);
        testList.add(2);
        testList.add(4);
        assertThat(_exercise2_true.getTestList(), is(testList));
    }
}

@@ -810,17 +810,17 @@
 stVal2To
-4
+6
 _WhenTru
@@ -847,36 +847,35 @@
 That(_exercise2_
-fals
+tru
 e.getTestVal2(),
@@ -878,17 +878,17 @@
 2(), is(
-4
+6
 ));%0A    
@@ -932,25 +932,25 @@
 veTestVal2To
-6
+4
 _WhenFalse()
@@ -998,33 +998,33 @@
 tTestVal2(), is(
-6
+4
 ));%0A    %7D%0A%0A    @

Fix for test in Exercises2