package bank;

import org.hamcrest.core.Is;
import org.junit.Test;

import java.util.ArrayList;
import java.util.Arrays;

import static org.hamcrest.core.Is.is;
import static org.junit.Assert.assertThat;
import static org.junit.Assert.fail;

/**
 * Test for class  with class ValidateStubInput and StubOutput.
 *
 * @author vryazanov
 * @version 1.0
 * @since 27.02.2017
 */




/**
 * Created by vr on 15.03.2017.
 */
public class BankTest {
    /**
     * If one client go in and out in different time.
     */
    @Test
    public void whenOneInOutThenShowWhenItWas() {
        Bank bank = new Bank(8,20, new Event[] {new In(9), new Out(10)});
        ArrayList<TimeRange> timeRanges = bank.findMaxLoad(bank.createTimetable());
        ArrayList<Long> result = new ArrayList<Long>();
        for (TimeRange timeRange : timeRanges) {
            result.add(timeRange.getTimeFrom());
            result.add(timeRange.getTimeTo());
        }
        final Long[] expectedOutput = new Long[]{9L, 10L};
        assertThat(result, is(Arrays.asList(expectedOutput)));
    }




}

@@ -1063,14 +1063,694 @@
 ;%0A    %7D%0A
+    /**%0A     * If one client go in and out in different time for 2 times.%0A     */%0A    @Test%0A    public void whenOneInOut2TimesThenShowWhenItWas() %7B%0A        Bank bank = new Bank(8,20, new Event%5B%5D %7Bnew In(9), new Out(10), new In(13), new Out(14)%7D);%0A        ArrayList%3CTimeRange%3E timeRanges = bank.findMaxLoad(bank.createTimetable());%0A        ArrayList%3CLong%3E result = new ArrayList%3CLong%3E();%0A        for (TimeRange timeRange : timeRanges) %7B%0A            result.add(timeRange.getTimeFrom());%0A            result.add(timeRange.getTimeTo());%0A        %7D%0A        final Long%5B%5D expectedOutput = new Long%5B%5D%7B9L, 10L, 13L, 14L%7D;%0A        assertThat(result, is(Arrays.asList(expectedOutput)));%0A    %7D%0A
 %0A%0A%0A%0A%7D%0A

add at the beginning