I follow the great tutorial and seem to understand everything. However when I run the JUnit test it fails the testPerson test. The other two pass without a problem.
I have:
public void testPerson() {
Person p1 = new Person ();
assertEquals("unknown name", p1.getName());
assertEquals(3, p1.getMaximumBooks());
}
Can someone suggest why I am failing this test of the code?
The tutorial is excellent! I am enjoying it and look forward to every lesson.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I follow the great tutorial and seem to understand everything. However when I run the JUnit test it fails the testPerson test. The other two pass without a problem.
I have:
public void testPerson() {
Person p1 = new Person ();
assertEquals("unknown name", p1.getName());
assertEquals(3, p1.getMaximumBooks());
}
Can someone suggest why I am failing this test of the code?
The tutorial is excellent! I am enjoying it and look forward to every lesson.
Resolved, I found the error in the Person method which should have been "unknown name" instead of simply "unknown".
Hi. What does the fail message say? Can you please paste in the entire source code for the Person class? Thanks. Mark
No no, the error was a typo I made. Not your material. Sorry for not being clear.
I had typed in "unknown" when I should have entered "unknown name".