Assert setReadStatus function
authorReto Buerki <reet@codelabs.ch>
Tue, 20 Mar 2012 09:54:52 +0000 (10:54 +0100)
committerReto Buerki <reet@codelabs.ch>
Tue, 20 Mar 2012 09:54:52 +0000 (10:54 +0100)
src/ch/codelabs/gitter/test/CommitDbAdapterTest.java

index 885dade..55a1bd9 100644 (file)
@@ -56,6 +56,13 @@ public class CommitDbAdapterTest extends AndroidTestCase {
                assertEquals("testdata", c.getString(c
                                .getColumnIndexOrThrow(CommitDbAdapter.KEY_CONTENT)));
 
+               commitDbAdapter.setReadStatus(id, true);
+
+               /* Re-fetch commit and assert read status */
+               final Cursor i = commitDbAdapter.fetchCommit(id);
+               assertEquals(1,
+                               i.getInt(i.getColumnIndexOrThrow(CommitDbAdapter.KEY_READ)));
+
                commitDbAdapter.deleteCommit(id);
                c.close();
                commitDbAdapter.close();