Assert KEY_HASH in commit test
authorReto Buerki <reet@codelabs.ch>
Tue, 20 Mar 2012 10:38:14 +0000 (11:38 +0100)
committerReto Buerki <reet@codelabs.ch>
Tue, 20 Mar 2012 10:38:14 +0000 (11:38 +0100)
src/ch/codelabs/gitter/test/CommitDbAdapterTest.java

index d30e985..fc09d01 100644 (file)
@@ -34,17 +34,20 @@ public class CommitDbAdapterTest extends AndroidTestCase {
         * Insert commit into database.
         */
        public void testInsertCommit() {
+               final String testHash = "fc7a3c29b985d90f271c7b9ea9f095729759799c";
                final CommitDbAdapter commitDbAdapter = new CommitDbAdapter(
                                getContext());
                commitDbAdapter.open();
 
-               final long id = commitDbAdapter.insertCommit("Update TODO",
+               final long id = commitDbAdapter.insertCommit("Update TODO", testHash,
                                "John Doe doe@example.com", "http://1.com/abc", "testdata");
 
                final Cursor c = commitDbAdapter.fetchAllCommits();
                assertTrue(c.getCount() > 0);
 
                c.moveToLast();
+               assertEquals(testHash,
+                               c.getString(c.getColumnIndexOrThrow(CommitDbAdapter.KEY_HASH)));
                assertEquals(0,
                                c.getInt(c.getColumnIndexOrThrow(CommitDbAdapter.KEY_READ)));
                assertEquals("Update TODO",