March 2015
Intermediate to advanced
236 pages
5h 26m
English
The next test demonstrates that matches returns false when the Profile instance contains no matching Answer object:
| iloveyouboss/tdd-9/test/iloveyouboss/ProfileTest.java | |
| | public class ProfileTest { |
* | private Answer answerThereIsNotRelocation; |
| | // ... |
| | @Before |
| | public void createQuestionAndAnswer() { |
| | questionIsThereRelocation = |
| | new BooleanQuestion(1, "Relocation package?"); |
| | answerThereIsRelocation = |
| | new Answer(questionIsThereRelocation, Bool.TRUE); |
* | answerThereIsNotRelocation = |
* | new Answer(questionIsThereRelocation, Bool.FALSE); |
| | } |
| | // ... |
* | @Test |
* | public void doesNotMatchWhenNoMatchingAnswer() { |
* | profile.add(answerThereIsNotRelocation); |
* | Criterion criterion = |
* | new Criterion(answerThereIsRelocation, ... |
Read now
Unlock full access