1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859 |
-
-
- import static org.junit.Assert.*;
- import org.junit.After;
- import org.junit.Before;
- import org.junit.Test;
-
- /**
- * The test class BubblesTest.
- *
- * @author (your name)
- * @version (a version number or a date)
- */
- public class BubblesTest
- {
- /**
- * Default constructor for test class BubblesTest
- */
- public BubblesTest()
- {
- }
-
- /**
- * Sets up the test fixture.
- *
- * Called before every test case method.
- */
- @Before
- public void setUp()
- {
- }
-
- /**
- * Tears down the test fixture.
- *
- * Called after every test case method.
- */
- @After
- public void tearDown()
- {
- }
-
- @Test
- public void bTest()
- {
- Bubbles bubbles1 = new Bubbles();
- boolean flag = false;
- int[] test = new int[]{9, 8, 2, 3, 1, 5, 6};
- test = bubbles1.bubbleSort(test);
- for (int i = 0; i < test.length-2; i++) {
- if (test[i] < test[i+1]) {
- flag = true;
- }
- }
- assertEquals(true, flag);
- }
- }
-
|