I was wondering if someone could help me out | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

I was wondering if someone could help me out

I want to send the code to someone I get 5/10 to run but having trouble with the other 5

10th Feb 2019, 4:55 PM
Tony Saya
Tony Saya - avatar
4 Answers
+ 1
Insert code
10th Feb 2019, 4:57 PM
Ramshek Rana
Ramshek Rana - avatar
0
Example of using unit tests for this assignment. To run them on the command line, make * sure that the junit-cs211.jar is in the same directory. * * On Mac/Linux: * javac -cp .:junit-cs211.jar *.java # compile everything * java -cp .:junit-cs211.jar P1tester # run tests * * On windows replace colons with semicolons: (: with ;) * demo$ javac -cp .;junit-cs211.jar *.java # compile everything * demo$ java -cp .;junit-cs211.jar P1tester # run tests */ import org.junit.*; import static org.junit.Assert.*; import java.util.*; public class P1tester { public static void main(String args[]){ org.junit.runner.JUnitCore.main("P1tester");@Test public void test1_inOrder_00() { assertTrue(DataProcessor.inOrder(new int[]{})); } @Test public void test1_inOrder_01() { assertTrue(DataProcessor.inOrder(new int[]{0})); } @Test public void test1_inOrder_02() { assertTrue(DataProcessor.inOrder(new int[]{1})); } @Test public void test1_inOrder_03() { assertTrue(DataProcessor.inOrder(new int[]{2})); }
10th Feb 2019, 5:13 PM
Tony Saya
Tony Saya - avatar
0
Test public void test1_inOrder_04() { assertTrue(DataProcessor.inOrder(new int[]{0,1})); } @Test public void test1_inOrder_05() { assertTrue(DataProcessor.inOrder(new int[]{0,1,2})); } @Test public void test1_inOrder_06() { assertTrue(DataProcessor.inOrder(new int[]{0,1,2,3})); } @Test public void test1_inOrder_07() { assertTrue(DataProcessor.inOrder(new int[]{0,1,2,3,4})); } @Test public void test1_inOrder_08() { assertTrue(DataProcessor.inOrder(new int[]{0,2,4,6,8})); } @Test public void test1_inOrder_09() { assertTrue(DataProcessor.inOrder(new int[]{0,3,4,9,22})); } @Test public void test1_inOrder_10() { assertTrue(DataProcessor.inOrder(new int[]{0,0,1,1,2,2})); } @Test public void test1_inOrder_11() { assertTrue(DataProcessor.inOrder(new int[]{0,4,6,6,9})); }
10th Feb 2019, 5:14 PM
Tony Saya
Tony Saya - avatar
0
Test public void test1_inOrder_12() { assertFalse(DataProcessor.inOrder(new int[]{0,-1})); } @Test public void test1_inOrder_13() { assertFalse(DataProcessor.inOrder(new int[]{1,0})); } @Test public void test1_inOrder_14() { assertFalse(DataProcessor.inOrder(new int[]{1,2,1})); } @Test public void test1_inOrder_15() { assertFalse(DataProcessor.inOrder(new int[]{1,2,2,0})); } @Test public void test1_inOrder_16() { assertFalse(DataProcessor.inOrder(new int[]{1,2,1,3})); } @Test public void test1_inOrder_17() { assertFalse(DataProcessor.inOrder(new int[]{1,2,3,4,2,6})); } @Test public void test1_inOrder_18() { assertFalse(DataProcessor.inOrder(new int[]{1,2,0,1,2,3})); } @Test public void test1_inOrder_19() { assertTrue(DataProcessor.inOrder(new int[]{1,1,1,1,1,1})); }
10th Feb 2019, 5:15 PM
Tony Saya
Tony Saya - avatar