helper.tearDown();
}
@Test
public void getTest() {
Center sgp = CenterRepository.add("singapore");
ContactDetails contactDetails = new ContactDetails();
contactDetails.firstName = "sathya";
contactDetails.email = "sathya.t@ishafoundation.org";
MemberRepository.add(contactDetails, sgp.id, SUPER_USER);
Member member = MemberRepository.get("sathya.t@ishafoundation.org", "sathya.t@ishafoundation.org");
assertTrue(member != null);
assertTrue(member.id != 0);
assertTrue(member.contactDetails.firstName.equals("sathya"));
assertTrue(member.contactDetails.email.equals("sathya.t@ishafoundation.org"));
assertTrue(member.owningCenter.id == sgp.id);
assertTrue(member.owningCenter.name.equals("singapore"));
//cannot get by non existant email or id
assertTrue(null == MemberRepository.get("nonexistant@email.com", SUPER_USER));
assertTrue(null == MemberRepository.get(1093890, SUPER_USER));
Center penang = CenterRepository.add("penang");
Center kl = CenterRepository.add("kl");
MemberRepository.addCenter(member.id, penang.id, USER_WITH_EDITMEMBER_PRIVILEGE);
MemberRepository.addCenter(member.id, kl.id, USER_WITH_EDITMEMBER_PRIVILEGE);
member = MemberRepository.get(member.id, SUPER_USER);
assertTrue(member.id != 0);