package ru.matevosyan;

import org.junit.Test;

import java.util.ArrayList;

import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.is;


/**
 * EvenNumberTest class.
 * Created on 28.04.2017.
 * @author Matevosyan Vardan
 * @version 1.0
 */

public class EvenNumberTest {

    /**
     * whenPassTwoDimensionSquareArrayThanIterateAndReturnTheSameValue was created to test two methods.
     * in {@link EvenNumber}. When passing square array, program iterate through all elements.
     * and return each of them, finally test check if our expected value is equal to actual value.
     */

    @Test
    public void whenPassTwoDimensionSquareArrayThanIterateAndReturnTheSameValue() {
        int[] actualArray = new int[]{1, 2, 3, 4};
        EvenNumber evenNumberIterator = new EvenNumber(actualArray);

        ArrayList<Integer> actualValue = new ArrayList<>();

        ArrayList<Integer> expected = new ArrayList<>();
        expected.add(2);
        expected.add(4);

        while (evenNumberIterator.hasNext()) {
            actualValue.add(evenNumberIterator.next());
        }

        assertThat(actualValue, is(expected));
    }


}
@@ -1168,10 +1168,996 @@
 %0A    %7D%0A%0A
+    /**%0A     * whenPassTwoDimensionSquareArrayThanCheckHasNextReturnValueIs was created to test hasNext methods.%0A     * in %7B@link EvenNumber%7D. When passing square array, program iterate through all elements.%0A     * and return each of them, finally test check if we has more element to get? then get it and check one more.%0A     * to be shore that is not there.%0A     */%0A%0A    @Test%0A    public void whenPassTwoDimensionSquareArrayThanCheckHasNextReturnValueIs() %7B%0A        int%5B%5D actualArray = new int%5B%5D%7B1, 2, 3, 4%7D;%0A        EvenNumber evenNumberIterator = new EvenNumber(actualArray);%0A%0A        ArrayList%3CInteger%3E arrayList = new ArrayList%3C%3E();%0A        arrayList.add(2);%0A        arrayList.add(4);%0A%0A        boolean actual = evenNumberIterator.hasNext();%0A        evenNumberIterator.next();%0A        evenNumberIterator.next();%0A        boolean checkIndexOutElement = evenNumberIterator.hasNext();%0A%0A        assertThat(actual, is(true));%0A%0A        assertThat(checkIndexOutElement, is(false));%0A    %7D%0A%0A
 %0A%7D

add one more test