Your SlideShare is downloading. ×
SQLite 周りのテストをしよう
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×

Introducing the official SlideShare app

Stunning, full-screen experience for iPhone and Android

Text the download link to your phone

Standard text messaging rates apply

SQLite 周りのテストをしよう

4,487
views

Published on

第 1 回 Android テスト祭りで SQ発表した資料

第 1 回 Android テスト祭りで SQ発表した資料

Published in: Technology, Art & Photos

0 Comments
12 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total Views
4,487
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
45
Comments
0
Likes
12
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
No notes for slide
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • Transcript

    • 1. context = new RenamingDelegatingContext( getContext(), "test_");helper = new TestterSQLiteOpenHelper( context);
    • 2. public class IconSQLiteDaoTest extends DatabaseTestCase { private IconDao iconDao; @Override protected void setUp() throws Exception { super.setUp(); importData(FileType.Yaml, "IconSQLiteDaoTest"); iconDao = new IconSQLiteDao(getSQLiteDatabase()); } @Override protected SQLiteOpenHelper createSQLiteOpenHelper() { return new TestterSQLiteOpenHelper(getDatabaseContext()); } public void testFindByUrl() { Icon icon = iconDao.findByUrl("http://a2.twimg.com/profile_images/1039340061/face_normal.png"); assertEquals(1, icon.id.intValue()); assertEquals("http://a2.twimg.com/profile_images/1039340061/face_normal.png", icon.url); assertEquals(1307203506481L, icon.createdAt.longValue());
    • 3. public class MigrationTest extends DatabaseTestCase { @Override protected SQLiteOpenHelper createSQLiteOpenHelper() { return new FixtureV1MigrationOpenHelper(getDatabaseContext()); } public void testV1Migration() { importData(FileType.Csv, "migrationTest"); ColumnInfo[] infos = loadColumnInfos("user"); assertEquals(5, infos.length); assertEquals("_id", infos[0].getName()); assertEquals("name", infos[1].getName()); assertEquals("weight", infos[2].getName()); assertEquals("image", infos[3].getName()); assertEquals("created", infos[4].getName()); replaceSQLiteOpenHelper(newFixtureMigrationOpenHelper(getDatabaseContext())); infos = loadColumnInfos("user"); assertEquals(6, infos.length);