import org.junit.Assert;
import org.junit.Test;

import java.util.Arrays;
import java.util.Collections;

import static org.junit.Assert.*;

public class ArrazTest {

    Arraz arraz = new Arraz();

    int[] arr = {2,2,2,2,2};
    int[] arr2 = {1,2,3,4,5};

    @Test
    public void test1sumValuesOfArray(){

        int expected = 10;
        int actual = arraz.sumValuesOfArray(arr);

        Assert.assertEquals(expected, actual);
    }


    @Test
    public void test2sumValuesOfArray(){

        int expected = 15;
        int actual = arraz.sumValuesOfArray(arr2);

        Assert.assertEquals(expected, actual);
    }

    double[] arr3 = {2.0,2.0,2.0,2.0,2.0};


    @Test
    public void test1DoublesOfArray(){

        double expected = 10.0;
        double actual = arraz.sumDoublesOfArray(arr3);

        Assert.assertEquals(expected, actual);
    }

    double[] arr4 = {1.5 , 2.5 , 3.0,4.75,5.25};

    @Test
    public void test2DoublesOfArray(){

        double expected = 17.0;
        double actual = arraz.sumDoublesOfArray(arr4);

        Assert.assertEquals(expected, actual);
    }

    @Test
    public void test1AverageOfArray(){

        int expected = 2;
        int actual = arraz.averageOfArray(arr);

        Assert.assertEquals(expected, actual);

    }

    @Test
    public void test2AverageOfArray(){

        int expected = 3;
        int actual = arraz.averageOfArray(arr2);

        Assert.assertEquals(expected, actual);

    }

    @Test
    public void test1DoubleAverageOfArray(){

        double expected = 2.0;
        double actual = arraz.doubleAverageOfArray(arr3);

        Assert.assertEquals(expected, actual);

    }

    @Test
    public void test2DoubleAverageOfArray(){

        double expected = (17.0 / 5.0);
        double actual = arraz.doubleAverageOfArray(arr4);

        Assert.assertEquals(expected, actual);

    }

    @Test
    public void test1ContainsValue(){
        int value = 4;

        boolean actual = arraz.containsValue(arr, value);

        Assert.assertFalse(actual);
    }

    @Test
    public void test2ContainsValue(){
        int value = 2;

        boolean actual = arraz.containsValue(arr, value);

        Assert.assertTrue(actual);
    }

    int[] array1 = {1,2,3,4,5};

    @Test
    public void test1ReverseArray(){

        int[] expected = {5,4,3,2,1};
        int[] actual = arraz.reverseArray(array1);

        Assert.assertEquals(Arrays.toString(expected), Arrays.toString(actual));
    }

    int[] array2 = {10,2,4,7,2};

    @Test
    public void test2ReverseArray(){

        int[] expected = {2,7,4,2,10};
        int[] actual = arraz.reverseArray(array2);

        Assert.assertTrue(Arrays.equals(expected, actual));

    }



    //int[] array1 = {1,2,3,4,5};



    @Test
    public void testGetOddEvensOfArray(){


        int[] expected = {1,2,3,4,5};
        int[] actual = arraz.reverseArray(array2);



    }

}