I am having problem passing a test code for name search, any mistakes!?
public boolean hasMember(String name)
{
for(Membership member: members)
{
if (member.getName().equals(name));
return true;
}
return false;
}
this is the test case:
public void testhasMember()
{
assertFalse(club1.hasMember("Jack"));
assertTrue(club2.hasMember("Jack"));
assertTrue(club2.hasMember("Ianto"));
assertTrue(club2.hasMember("Owen"));
assertTrue(club2.hasMember("Rhys"));
assertFalse(club2.hasMember("David"));
}