use of indi.mybatis.flying.pojo.Account_ in project mybatis.flying by limeng32.
the class NullOrNotTest method testNullOrNot.
/**
* 测试NullOrNot关键字
*/
@Test
@DatabaseSetup(type = DatabaseOperation.CLEAN_INSERT, value = "/indi/mybatis/flying/test/nullOrNotTest/testNullOrNot.xml")
@ExpectedDatabase(assertionMode = DatabaseAssertionMode.NON_STRICT, value = "/indi/mybatis/flying/test/nullOrNotTest/testNullOrNot.result.xml")
@DatabaseTearDown(type = DatabaseOperation.DELETE_ALL, value = "/indi/mybatis/flying/test/nullOrNotTest/testNullOrNot.xml")
public void testNullOrNot() {
Account_Condition ac = new Account_Condition();
ac.setEmailIsNull(true);
Collection<Account_> accountC = accountService.selectAll(ac);
Assert.assertEquals(1, accountC.size());
int count = accountService.count(ac);
Assert.assertEquals(1, count);
Account_Condition ac2 = new Account_Condition();
ac2.setEmailIsNull(false);
Collection<Account_> accountC2 = accountService.selectAll(ac2);
Assert.assertEquals(1, accountC2.size());
int count2 = accountService.count(ac2);
Assert.assertEquals(1, count2);
Account_Condition ac3 = new Account_Condition();
Collection<Account_> accountC3 = accountService.selectAll(ac3);
Assert.assertEquals(2, accountC3.size());
int count3 = accountService.count(ac3);
Assert.assertEquals(2, count3);
Account_Condition ac4 = new Account_Condition();
ac4.setRoleIsNull(true);
Collection<Account_> accountC4 = accountService.selectAll(ac4);
for (Account_ a : accountC4) {
Assert.assertEquals("bob", a.getName());
}
int count4 = accountService.count(ac4);
Assert.assertEquals(1, count4);
Account_Condition ac5 = new Account_Condition();
ac5.setRoleIsNull(false);
Collection<Account_> accountC5 = accountService.selectAll(ac5);
for (Account_ a : accountC5) {
Assert.assertEquals("ann", a.getName());
}
int count5 = accountService.count(ac5);
Assert.assertEquals(1, count5);
}
use of indi.mybatis.flying.pojo.Account_ in project mybatis.flying by limeng32.
the class SelectOneTest method testSelectOne3.
/**
* 测试selectOne3,缓存测试
*/
@Test
@DatabaseSetup(type = DatabaseOperation.DELETE_ALL, value = "/indi/mybatis/flying/test/selectOneTest/testSelectOne3.xml")
@ExpectedDatabase(assertionMode = DatabaseAssertionMode.NON_STRICT, value = "/indi/mybatis/flying/test/selectOneTest/testSelectOne3.result.xml")
@DatabaseTearDown(type = DatabaseOperation.DELETE_ALL, value = "/indi/mybatis/flying/test/selectOneTest/testSelectOne3.result.xml")
public void testSelectOne3() {
Account_ a1 = new Account_();
a1.setName("ann");
accountService.insert(a1);
Account_ a2 = new Account_();
a2.setName("bob");
accountService.insert(a2);
Account_ ac = new Account_();
Account_ account1 = accountService.selectOne(ac);
Assert.assertEquals("ann", account1.getName());
Collection<Account_> accountC = accountService.selectAll(ac);
Assert.assertEquals(2, accountC.size());
}
Aggregations