@Test public void delete() { Account acc = accountDao.getAccountByUsername("admin"); if (acc != null) { accountDao.delete(acc.getAccountId()); } }
@Test public void insert() { Account acc = accountDao.getAccountByUsername("admin"); if (acc != null) { accountDao.delete(acc.getAccountId()); } Account account = new Account(); account.setUsername("admin"); account.setPassword("amdin"); account.setFullName("Grubby"); accountDao.insert(account); }
@Test public void selectOne() { Account account = accountDao.selectByPrimaryKey(1); Assert.assertEquals(account.getUsername(), "test01"); Assert.assertEquals(account.getPassword(), "test01"); }