1. Engineering
  2. Computer Science
  3. no output is needed just need to test java code...

Question: no output is needed just need to test java code...

Question details

Description: Implement the following method, which tests whether a two-dimensional list has four consecutive numbers of the same value, either horizontally, vertically, or diagonally public static boolean isConsecutiveFour(int[Il values) Write a series of JUnit test cases that will pass-in a 2-dim array and verify correct results. Your test cases should include both successful executions as well as tests for arrays containing non-consecutive numbers. Remember to take into account non-square arrays (Ex. 1x4). 0 10 3 1 6 1 0 10 3 1 6 1 0 1 0 3 161 0 1 6 8 6 0 1 5 6 2 1 8 29 5 5 2 1 8 2 95 6 2 1 6 2 9 9 6 2 1 82 9 6 5 61 1 9 1 1 3 6 1 407 15 61 4 071 3 61 407 1 391 4 0 7 3 3 3 3 4 0 7 0 1 0 3 1 6 1 0 1 6 86 0 1 0 1 6 8 6 0 1 6 5 6 11 9 1 3 5 3 3 40 0 1 6 8 6 0 1 6 961 1 9 1 3 3 3 9 407 6 5 6 6 1 91 Realize that you are simply replicating the actions you would perform manually in an automated way. Essentially, write the code to do what you yourself would do to test the correctness of your code. Your tests do not have to be overly complicated, or extremely robust. Quality test cases (methods) can be written rather quickly once you get the hang of it. If you find yourself spending more than a few minutes on a test case, please simplify your approach and thought process, you are most likely OVER THINKING the problem. If that doesnt help, please seek help (instructor, tutor, generous genius classmate) Notes: Packaging: Fully qualified class names are listed below . edu.ben.homeworks.homework1.Homework1.java . edu.ben.homeworks.homework1.Homework1Test.java

No output is needed just need to test

JAVA CODE and it should have two classes

-One where the code is

-second where the JUNIT Test is see example below

Homeworko.java | DỊ HomeworkOTest.java33 ії in..in packagehomeworks. homeworke; 1 package e 3 public class Homeworke 5 public static void main(Stringll args) f homeworks. homeworke; 3+ import org. junit.Test: public class HomeworkeTest extends TestCase t System.out.print n(Helto wortd) @Test public void test) f String expected:,Hello, world!\n; Homeworke.main nulu) String actual systemout.getHistory); assertEquals (expected, actua): 10 12 h 16

Solution by an expert tutor
Blurred Solution
This question has been solved
Subscribe to see this solution