|
@@ -0,0 +1,29 @@
|
|
1
|
+package rocks.zipcode.calcskin;
|
|
2
|
+
|
|
3
|
+import org.junit.Assert;
|
|
4
|
+import org.junit.Test;
|
|
5
|
+
|
|
6
|
+public class WhiteBoardTest {
|
|
7
|
+
|
|
8
|
+ @Test
|
|
9
|
+ public void sortTest(){
|
|
10
|
+ int[] input = new int[]{2, 5, -55, 8, -72, -1, 53};
|
|
11
|
+ String arrayToString = "";
|
|
12
|
+ for (int j = 0; j<input.length; j++)
|
|
13
|
+ for (int i = 0; i < input.length-1; i++) {
|
|
14
|
+ int temp = input[i++];
|
|
15
|
+ if(input[i]>input[i++]){
|
|
16
|
+ input[i++] = input[i];
|
|
17
|
+ input[i] = temp;
|
|
18
|
+ arrayToString += input[i] + " ";
|
|
19
|
+ System.out.println(input[i]);
|
|
20
|
+ }
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+ }
|
|
24
|
+
|
|
25
|
+ String actual = "-72 -55 -1 2 5 8 53";
|
|
26
|
+
|
|
27
|
+ Assert.assertEquals(arrayToString, actual);
|
|
28
|
+ }
|
|
29
|
+}
|