package ru.revdaalex.calculator;

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

/**
 * Test MenuValidator.
 * Created by RevdaAlex on 19.06.2016.
 */
public class MenuValidatorTest {
    /**
     * Test validMainMenu() method.
     */
    @Test
    public void checkWhenTheUserSelectsMenuItem(){
        MockIO mockIO = new MockIO(new String[]{"1"});
        MenuValidator menuValidator = new MenuValidator(mockIO);
        Assert.assertThat(menuValidator.validMainMenu(), is(1));
    }

    /**
     * Test validCalcResultMenu() method.
     */
    @Test
    public void checkWhenTheUserSelectsOperator(){
        MockIO mockIO = new MockIO(new String[]{"3"});
        MenuValidator menuValidator = new MenuValidator(mockIO);
        Assert.assertThat(menuValidator.validCalcResultMenu(), is(3));
    }

    /**
     * Test validEngineerMenu() method.
     */
    @Test
    public void checkWhenTheUserSelectEngineerMenu(){
        MockIO mockIO = new MockIO(new String[]{"7"});
        MenuValidator menuValidator = new MenuValidator(mockIO);
        Assert.assertThat(menuValidator.validEngineerMenu(), is(7));
    }

    /**
     * Test validEngineerOperation() method.
     */
    @Test
    public void checkWhenUserSelectEngineerOperator(){
        MockIO mockIO = new MockIO(new String[]{"3"});
        MenuValidator menuValidator = new MenuValidator(mockIO);
        Assert.assertThat(menuValidator.validEngineerOperation(), is(3));
    }

}
@@ -1009,17 +1009,17 @@
 ring%5B%5D%7B%22
-7
+1
 %22%7D);%0A   
@@ -1148,9 +1148,9 @@
  is(
-7
+1
 ));%0A

update MenuValidatorTest.java