|
Method Test
Listing 1. JUnit tests verify whether requirements are met and can be coded manually or generated automatically with a unit testing technology that creates JUnit test cases for every method in the source code. In this case we create the JUnit test class with a test case to test the getMortgageResponse() method. public class RealtorServiceImplTest extends
PackageTestCase {
/**
* Test for method: getMortgageResponse(PaymentInfo)
* @see RealtorServiceImpl#getMortgageResponse(
* PaymentInfo)
* @author Jtest
* @throws junit.framework.AssertionFailedError
*/
public void testGetMortgageResponse() {
PaymentInfo t0 = new PaymentInfo(7.0, 7.0, 7.0, 7);
RealtorServiceImpl THIS = new RealtorServiceImpl();
// jtest_tested_method
double RETVAL = THIS.getMortgageResponse(t0);
assertEquals(0.0, RETVAL, 0.0); // jtest_unverified
}
... other test cases ...
}
|