Question: An Integer will be passed to your method. Convert that Integer into a String. The first Integer will be 1. The second will be 20.


An Integer will be passed to your method. Convert that Integer into a String. The first Integer will be 1. The second will be 20. The JUnit file looks like this: import org.junit.Assert: import org.junit. Test: import static org.junit. Assert.assertArrayEquals: public class MyTest @Test // method public void testOne({ // // Test 1 Input and Desired Output System.out.println("Subtest 1: input string is 1"); String stringInput = "1"; Integer intOutput = Integer.parseInt(stringInput); // send integer in, hoping that a string will be output String methodOut = Utils.intToString(intOutput); Assert. assertEquals((long)Integer.parseInt(methodOut),(long)intOutput): // // Test 2 Input and Desired Output System.out.println("Subtest 2: input string is 20"); stringInput = "20"; intOutput = Integer.parseInt(stringinput); // send integer in, hoping that a string will be output methodOut = Utils.intToString(intOutput); Assert assertEquals((long)Integer.parseInt(methodOut) (long)intOutput): } // end method }
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
