Midterm-v2-solution

This functionality can be tested by picking two

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: mainder of an integer division by calling the following method on the calculator: public int remainder(int x, int y) Part a [5 marks] Suppose you wanted to write a test for the remainder functionality of the calculator. Describe, in English, one way you could test its functionality. I expect the detail and order of the English language description to map fairly transparently onto a JUnit test expressed in Java. This functionality can be tested by picking two integers, say 10 and 3, and setting up the test method to have the calculator compute the remainder by calling remainder(10,3), and then verifying that the actual value computed was indeed the correct answer, 1 in this case. Part b [5 marks] Write Java code which expresses the test you described above as a JUnit 4 test method. Do not write a class definition, give just the test method's definition. You...
View Full Document

Ask a homework question - tutors are online