@@ -0,0 +1,2283 @@
+package ru.revdaalex.calculator;%0A%0Aimport org.junit.Assert;%0Aimport org.junit.Test;%0Aimport static org.hamcrest.core.Is.is;%0A%0A/**%0A * InteractCalc test.%0A * Created by revdaalex on 16.06.2016.%0A */%0Apublic class InteractCalcTest %7B%0A    /**%0A     * Test add.%0A     */%0A    @Test%0A    public void whenTakeSumAndExit()%7B%0A        MockIO mockIO = new MockIO(new String%5B%5D%7B%221%22, %221%22, %221%22, %227%22%7D);%0A        Calculator calculator = new Calculator();%0A        new InteractCalc(calculator,  mockIO).start();%0A        Assert.assertThat(calculator.getResult(), is(2.0));%0A    %7D%0A%0A    /**%0A     * Test subtraction.%0A     */%0A    @Test%0A    public void whenTakeSubAndExit()%7B%0A        MockIO mockIO = new MockIO(new String%5B%5D%7B%222%22, %2210%22, %225%22, %227%22%7D);%0A        Calculator calculator = new Calculator();%0A        new InteractCalc(calculator,  mockIO).start();%0A        Assert.assertThat(calculator.getResult(), is(5.0));%0A    %7D%0A%0A    /**%0A     * Test multiplication.%0A     */%0A    @Test%0A    public void whenTakeMultAndExit()%7B%0A        MockIO mockIO = new MockIO(new String%5B%5D%7B%223%22, %2210%22, %222%22, %227%22%7D);%0A        Calculator calculator = new Calculator();%0A        new InteractCalc(calculator,  mockIO).start();%0A        Assert.assertThat(calculator.getResult(), is(20.0));%0A    %7D%0A%0A    /**%0A     * Test division.%0A     */%0A    @Test%0A    public void whenTakeDivAndExit()%7B%0A        MockIO mockIO = new MockIO(new String%5B%5D%7B%224%22, %2210%22, %225%22, %227%22%7D);%0A        Calculator calculator = new Calculator();%0A        new InteractCalc(calculator,  mockIO).start();%0A        Assert.assertThat(calculator.getResult(), is(2.0));%0A    %7D%0A%0A    /**%0A     * Test add and addition reuse result.%0A     */%0A    @Test%0A    public void whenTakeSumAndSumReuseResultThenExit()%7B%0A        MockIO mockIO = new MockIO(new String%5B%5D%7B%221%22, %2210%22, %225%22, %225%22, %225%22, %221%22, %227%22%7D);%0A        Calculator calculator = new Calculator();%0A        new InteractCalc(calculator,  mockIO).start();%0A        Assert.assertThat(calculator.getResult(), is(20.0));%0A    %7D%0A%0A    /**%0A     * Test clear result.%0A     */%0A    @Test%0A    public void whenTakeSumThenClearResultAndExit()%7B%0A        MockIO mockIO = new MockIO(new String%5B%5D%7B%221%22, %22100%22, %2230%22, %226%22, %227%22%7D);%0A        Calculator calculator = new Calculator();%0A        new InteractCalc(calculator,  mockIO).start();%0A        Assert.assertThat(calculator.getResult(), is(0.0));%0A    %7D%0A%7D

add InteractCalcTest.java