desislava_topuzakova

4. Bubble Sort Test

Nov 26th, 2020
622
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. package p04_BubbleSortTest;
  2.  
  3. import org.junit.Assert;
  4. import org.junit.Test;
  5.  
  6. public class BubbleTest {
  7.  
  8.     @Test
  9.     public void testSort () {
  10.         int[] arr = {100, 13, 7, 0, - 5, 2};
  11.         Bubble.sort(arr); //сортира масива
  12.         int [] expectedSortedArray = {-5, 0, 2, 7, 13, 100};
  13.  
  14.         for (int i = 0; i < expectedSortedArray.length; i++) {
  15.             Assert.assertEquals(expectedSortedArray[i], arr[i]);
  16.         }
  17.     }
  18. }
  19.  
RAW Paste Data