@Test public void testSimple() { buffer.put(this.zero); buffer.put(StopSignal.getInstance()); QuickSort qs = QuickSort.create(buffer); assertEquals(zero, qs.getSmallestElement()); assertEquals(StopSignal.getInstance(), qs.getSmallestElement()); }
@Test public void testLessSimple() { buffer.put(this.fourtyTwo); buffer.put(this.ten); buffer.put(StopSignal.getInstance()); QuickSort qs = QuickSort.create(buffer); assertEquals(ten, qs.getSmallestElement()); assertEquals(fourtyTwo, qs.getSmallestElement()); assertEquals(StopSignal.getInstance(), qs.getSmallestElement()); }
public void test() { buffer.put(this.big); buffer.put(this.ten); buffer.put(this.zero); buffer.put(this.fourtyTwo); buffer.put(this.oneNegative); buffer.put(StopSignal.getInstance()); QuickSort qs = QuickSort.create(buffer); assertEquals(oneNegative, qs.getSmallestElement()); assertEquals(zero, qs.getSmallestElement()); assertEquals(fourtyTwo, qs.getSmallestElement()); assertEquals(big, qs.getSmallestElement()); assertEquals(StopSignal.getInstance(), qs.getSmallestElement()); }
@Test public void testEmpty() { buffer.put(StopSignal.getInstance()); QuickSort qs = QuickSort.create(buffer); assertEquals(StopSignal.getInstance(), qs.getSmallestElement()); }