+/EE422C

software design

git clone https://git.julia.blue/+/EE422C

Joseph RyanProject 1 and quiz 2ead272f

master
566 B25 linesraw
1import static org.junit.Assert.*;
2
3import org.junit.Test;
4
5public class SelectionSortTest {
6
7  @Test
8  public void test() {
9    int[] arr = new int[] {6, 1, 2, 8, 9, 3, 0, 5, 4, 7};
10    int[] expected = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9};
11    SelectionSort.sort(arr);
12    for (int i = 0; i < arr.length; i++) {
13      System.out.print(arr[i]);
14    }
15    assertArrayEquals(arr, expected);
16  }
17
18  @Test
19  public void test_swap() {
20    int[] arr = new int[] {1, 0};
21    int[] expected = {0, 1};
22    SelectionSort.swap(arr, 0, 1);
23    assertArrayEquals(arr, expected);
24  }
25}