Interface:
public interface HeapSort {
int[] setrid(int[] pole);
}
Ukázka testů:
public class TestHeapSort extends TestCase {
private HeapSort heapSort = null;
protected void setUp() throws Exception {
super.setUp();
/**@todo verify the constructors*/
int[] pole = {8,6,7,14,20,44,1,55,46,86};
heapSort = new HeapSort(pole);
}
protected void tearDown() throws Exception {
heapSort = null;
super.tearDown();
}
public void testGetHeapSort() {
int[] pole_expected = {1,6,7,8,14,20,44,46,55,86};
int[] pole_actual = heapSort.setridHeapSortem();
String expectedReturn = Arrays.toString(pole_expected);
String actualReturn = Arrays.toString(pole_actual);
assertEquals("return value", expectedReturn, actualReturn);
}
}