@Test public void deleteByPrimaryKey() { int result = tradeDao.deleteByPrimaryKey("1"); assertEquals(1, result); int a = tradeDao.countByExample(new Criteria()); assertEquals(1, a); }
@Test public void insert() { tradeDao.insert(getTrade().get(0)); int a = tradeDao.countByExample(new Criteria()); assertEquals(3, a); }
@Test public void deleteByExample() { Criteria example = new Criteria(); example.put("balance", 123); int result = tradeDao.deleteByExample(example); assertEquals(1, result); int a = tradeDao.countByExample(new Criteria()); assertEquals(1, a); }
@Test public void updateByPrimaryKeySelective() { Trade trade = new Trade(); trade.setId("1"); trade.setBalance(new BigDecimal(123)); trade.setMyaccount("110"); int result = tradeDao.updateByPrimaryKeySelective(trade); assertEquals(1, result); trade = tradeDao.selectByPrimaryKey("1"); assertEquals("110", trade.getMyaccount()); }
@Test public void updateByExampleSelective() { Criteria example = new Criteria(); example.put("balance", 123); Trade trade = new Trade(); trade.setBalance(new BigDecimal(12)); trade.setMyaccount("110"); int result = tradeDao.updateByExampleSelective(trade, example); assertEquals(1, result); trade = tradeDao.selectByPrimaryKey("1"); assertEquals("110", trade.getMyaccount()); }
@Test public void insertSelective() { Trade trade1 = getTrade().get(0); Trade trade2 = getTrade().get(1); trade1.setId(null); trade2.setId(null); tradeDao.insertSelective(trade1); logger.info(trade1.getId()); tradeDao.insertSelective(trade2); logger.info(trade2.getId()); int a = tradeDao.countByExample(new Criteria()); assertEquals(4, a); }
@Test public void selectByExample() { Criteria example = new Criteria(); example.put("balance", 123); example.setOracleStart(0); example.setOracleEnd(10); List<Trade> list = tradeDao.selectByExample(example); assertEquals("1", list.get(0).getId()); }
@Test public void countByExample() { int a = tradeDao.countByExample(new Criteria()); logger.info("TestcountByExample() - int a=" + a); assertEquals(2, a); }
@Test public void selectByPrimaryKey() { Trade trade = tradeDao.selectByPrimaryKey("1"); assertEquals("abc", trade.getMyaccount()); }