Suppose you are testing a method called getsDiscount that determines whether or not a customer receives a discount on their bill based on their age. The method takes on argument of type int representing a person's age in years and returns a boolean value representing whether they receive a discount. Young children aged 6 years and younger receive a discount as do senior citizens aged 65 and older. Use black box testing principles to propose a set of unit tests (list what input you would use as a test value and what outcome you expect from the method being tested) that would ensure that this method is working correctly. Note that you don't need to write any unit tests, just state what input values you would use as part of your tests and the expected result.
a) Test input: 5, Expected outcome: True
b) Test input: 10, Expected outcome: False
c) Test input: 70, Expected outcome: True
d) Test input: 60, Expected outcome: False

Q&A Education