We will use JUnit, an industry standard unit testing framework, to write the tests.
The first thing is to define the interface.
Create an interface called BasicCalculator in your src/org/confucius folder.
It looks like this:
package org.confucius;
public interface BasicCalculator {
public int add (int a, int b) throws Exception;
}
The 'add' method finds the sum of two integers.
It throws an Exception if there is any problem.
No comments:
Post a Comment