use of iurii.job.interview.utils.pair.Pair in project algorithms by Iurii-Dziuban.
the class ProcessorsForTasksTest method testNegativeWithSorting.
@Test
public void testNegativeWithSorting() {
List<Pair> pairs = new ArrayList<>();
pairs.add(new Pair(1481122000, 1481122025));
pairs.add(new Pair(1481122030, 1481122045));
pairs.add(new Pair(1481122050, 1481122070));
assertThat(processorsForTasks.findTotalNumberOfProcessorsNeededWithSorting(pairs)).isEqualTo(1);
}
use of iurii.job.interview.utils.pair.Pair in project algorithms by Iurii-Dziuban.
the class ProcessorsForTasksTest method testSimpleWithSorting.
@Test
public void testSimpleWithSorting() {
List<Pair> pairs = new ArrayList<>();
pairs.add(new Pair(1481122000, 1481122020));
pairs.add(new Pair(1481122000, 1481122040));
pairs.add(new Pair(1481122030, 1481122035));
assertThat(processorsForTasks.findTotalNumberOfProcessorsNeededWithSorting(pairs)).isEqualTo(2);
}
use of iurii.job.interview.utils.pair.Pair in project algorithms by Iurii-Dziuban.
the class ProcessorsForTasksTest method testOneWithSorting.
@Test
public void testOneWithSorting() {
List<Pair> pairs = new ArrayList<>();
pairs.add(new Pair(1481122000, 1481122020));
pairs.add(new Pair(1481122020, 1481122040));
pairs.add(new Pair(1481122040, 1481122050));
assertThat(processorsForTasks.findTotalNumberOfProcessorsNeededWithSorting(pairs)).isEqualTo(1);
}
use of iurii.job.interview.utils.pair.Pair in project algorithms by Iurii-Dziuban.
the class CustomerServiceCapacityTest method testSimple.
@Test
public void testSimple() {
List<Pair> pairs = new ArrayList<>();
pairs.add(new Pair(1481122000, 1481122020));
pairs.add(new Pair(1481122000, 1481122040));
pairs.add(new Pair(1481122030, 1481122035));
assertThat(serviceCapacity.findNeededNumberOfEmployers(1, pairs)).isEqualTo(1);
}
Aggregations