コード例 #1
0
ファイル: MemberDaoTest.java プロジェクト: clawall/sal
  @Test
  public void testFindAllOrderedByName() {
    Member member = new Member();
    member.setEmail("*****@*****.**");
    member.setName("Jane Doe");
    member.setPhoneNumber("2125552121");
    memberDao.register(member);

    List<Member> members = memberDao.findAllOrderedByName();
    Assert.assertEquals(2, members.size());
    Member newMember = members.get(0);

    Assert.assertEquals("Jane Doe", newMember.getName());
    Assert.assertEquals("*****@*****.**", newMember.getEmail());
    Assert.assertEquals("2125552121", newMember.getPhoneNumber());
    return;
  }
コード例 #2
0
ファイル: MemberDaoTest.java プロジェクト: clawall/sal
  @Test
  public void testRegister() {
    Member member = new Member();
    member.setEmail("*****@*****.**");
    member.setName("Jane Doe");
    member.setPhoneNumber("2125552121");

    memberDao.register(member);
    Long id = member.getId();
    Assert.assertNotNull(id);

    Assert.assertEquals(2, memberDao.findAllOrderedByName().size());
    Member newMember = memberDao.findById(id);

    Assert.assertEquals("Jane Doe", newMember.getName());
    Assert.assertEquals("*****@*****.**", newMember.getEmail());
    Assert.assertEquals("2125552121", newMember.getPhoneNumber());
    return;
  }