Skip to content

Instantly share code, notes, and snippets.

@ParasoftExamples
Last active September 5, 2018 15:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ParasoftExamples/8b28da81e3a3717041169fbf880cb26b to your computer and use it in GitHub Desktop.
Save ParasoftExamples/8b28da81e3a3717041169fbf880cb26b to your computer and use it in GitHub Desktop.
Junit Parameterized Tests Example 1
public LoanResponse requestLoan(float loanAmount, float downPayment, float availableFunds)
{
LoanResponse response = new LoanResponse();
response.setApproved(true);
if (availableFunds < downPayment) {
response.setApproved(false);
response.setMessage("error.insufficient.funds.for.down.payment");
return response;
}
if (downPayment / loanAmount < 0.1) {
response.setApproved(false);
response.setMessage("error.insufficient.down.payment");
}
return response;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment