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 DimensionalIteratorTest}. 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}};
        DimensionalIterator dimensionalIterator = new DimensionalIterator(actualArray);

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

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

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

        assertThat(actualValue, is(expected));
    }

    /**
     * whenPassTwoDimensionRectangleArrayThanIterateAndReturnTheSameValue was created to test two methods.
     * in {@link DimensionalIteratorTest}. When passing rectangle array and array column is less than rows.
     * 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 whenPassTwoDimensionRectangleArrayThanIterateAndReturnTheSameValue() {
        int[][] actualArray = new int[][]{{1, 2}, {3, 4}, {5, 6}};
        DimensionalIterator dimensionalIterator = new DimensionalIterator(actualArray);

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

        ArrayList<Integer> expected = new ArrayList<>();
        expected.add(1);
        expected.add(2);
        expected.add(3);
        expected.add(4);
        expected.add(5);
        expected.add(6);

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

        assertThat(actualValue, is(expected));
    }

    /**
     * whenPassTwoDimensionRectangleArrayAndColumnsBiggerThanRowsThanIterateAndReturnTheSameValue was created to test two methods.
     * in {@link DimensionalIteratorTest}. When passing rectangle array and array column is bigger than rows.
     * 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 whenPassTwoDimensionRectangleArrayAndColumnsBiggerThanRowsThanIterateAndReturnTheSameValue() {
        int[][] actualArray = new int[][]{{1, 2, 3}, {4, 5, 6}};
        DimensionalIterator dimensionalIterator = new DimensionalIterator(actualArray);

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

        ArrayList<Integer> expected = new ArrayList<>();
        expected.add(1);
        expected.add(2);
        expected.add(3);
        expected.add(4);
        expected.add(5);
        expected.add(6);

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

        assertThat(actualValue, is(expected));
    }


}
@@ -430,39 +430,26 @@
  %7B@link 
-DimensionalIteratorTest
+EvenNumber
 %7D. When 
@@ -715,34 +715,32 @@
  %7B%0A        int%5B%5D
-%5B%5D
  actualArray = n
@@ -751,26 +751,20 @@
 nt%5B%5D
-%5B%5D%7B
 %7B1, 2
-%7D
 , 
-%7B
 3, 4%7D
-%7D
 ;%0A  
@@ -773,2579 +773,324 @@
     
-DimensionalIterator dimensionalIterator = new DimensionalIterator(actualArray);%0A%0A        ArrayList%3CInteger%3E actualValue = new ArrayList%3C%3E();%0A%0A        ArrayList%3CInteger%3E expected = new ArrayList%3C%3E();%0A        expected.add(1);%0A        expected.add(2);%0A        expected.add(3);%0A        expected.add(4);%0A%0A        while (dimensionalIterator.hasNext()) %7B%0A            actualValue.add(dimensionalIterator.next());%0A        %7D%0A%0A        assertThat(actualValue, is(expected));%0A    %7D%0A%0A    /**%0A     * whenPassTwoDimensionRectangleArrayThanIterateAndReturnTheSameValue was created to test two methods.%0A     * in %7B@link DimensionalIteratorTest%7D. When passing rectangle array and array column is less than rows.%0A     * program iterate through all elements and return each of them, finally test check if our expected value.%0A     * is equal to actual value.%0A     */%0A%0A    @Test%0A    public void whenPassTwoDimensionRectangleArrayThanIterateAndReturnTheSameValue() %7B%0A        int%5B%5D%5B%5D actualArray = new int%5B%5D%5B%5D%7B%7B1, 2%7D, %7B3, 4%7D, %7B5, 6%7D%7D;%0A        DimensionalIterator dimensionalIterator = new DimensionalIterator(actualArray);%0A%0A        ArrayList%3CInteger%3E actualValue = new ArrayList%3C%3E();%0A%0A        ArrayList%3CInteger%3E expected = new ArrayList%3C%3E();%0A        expected.add(1);%0A        expected.add(2);%0A        expected.add(3);%0A        expected.add(4);%0A        expected.add(5);%0A        expected.add(6);%0A%0A        while (dimensionalIterator.hasNext()) %7B%0A            actualValue.add(dimensionalIterator.next());%0A        %7D%0A%0A        assertThat(actualValue, is(expected));%0A    %7D%0A%0A    /**%0A     * whenPassTwoDimensionRectangleArrayAndColumnsBiggerThanRowsThanIterateAndReturnTheSameValue was created to test two methods.%0A     * in %7B@link DimensionalIteratorTest%7D. When passing rectangle array and array column is bigger than rows.%0A     * program iterate through all elements and return each of them, finally test check if our expected value.%0A     * is equal to actual value.%0A     */%0A%0A    @Test%0A    public void whenPassTwoDimensionRectangleArrayAndColumnsBiggerThanRowsThanIterateAndReturnTheSameValue() %7B%0A        int%5B%5D%5B%5D actualArray = new int%5B%5D%5B%5D%7B%7B1, 2, 3%7D, %7B4, 5, 6%7D%7D;%0A        DimensionalIterator dimensionalIterator = new DimensionalIterator(actualArray);%0A%0A        ArrayList%3CInteger%3E actualValue = new ArrayList%3C%3E();%0A%0A        ArrayList%3CInteger%3E expected = new ArrayList%3C%3E();%0A        expected.add(1);%0A        expected.add(2);%0A        expected.add(3);%0A        expected.add(4);%0A        expected.add(5);%0A        expected.add(6);%0A%0A        while (dimensionalIterator.hasNext()) %7B%0A            actualValue.add(dimensional
+EvenNumber evenNumberIterator = new EvenNumber(actualArray);%0A%0A        ArrayList%3CInteger%3E actualValue = new ArrayList%3C%3E();%0A%0A        ArrayList%3CInteger%3E expected = new ArrayList%3C%3E();%0A        expected.add(2);%0A        expected.add(4);%0A%0A        while (evenNumberIterator.hasNext()) %7B%0A            actualValue.add(evenNumber
 Iter

change test