任何人都可以帮助我解决这个问题:如何测试使用ormlite的android应用程序?如何测试android与ormlite项目
我想知道如何创建模拟道路。此代码让我一个DAO
public Dao<Account, Integer> getAccountDao() throws SQLException {
if (accountDao == null) {
accountDao = getDao(Account.class);
}
return accountDao;
}
我的测试活动中查找此:
public class OrmActivity extends OrmLiteBaseActivity<DatabaseHelper> {
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
initUi();
initUiListeners();
RuntimeExceptionDao<Account, Integer> accountDao = getHelper().getAccountDataDao();
Account account = new Account();
account.setName("name");
account.setPassword("password");
accountDao.create(account);
}
我不想做检查创建单独的数据库。我想用它来模仿它。
致以问候
THX的答复,我会检查它 – reizals
@christine - 你的roboelectric一个示例代码和ormlite共同努力 – rOrlig
我在这里盖了示例代码:www.christine.nl – Christine