Extend setReadStatus test (assert for false)
authorReto Buerki <reet@codelabs.ch>
Tue, 20 Mar 2012 10:16:04 +0000 (11:16 +0100)
committerReto Buerki <reet@codelabs.ch>
Tue, 20 Mar 2012 10:16:04 +0000 (11:16 +0100)
src/ch/codelabs/gitter/test/CommitDbAdapterTest.java

index 55a1bd9..d30e985 100644 (file)
@@ -59,10 +59,16 @@ public class CommitDbAdapterTest extends AndroidTestCase {
                commitDbAdapter.setReadStatus(id, true);
 
                /* Re-fetch commit and assert read status */
-               final Cursor i = commitDbAdapter.fetchCommit(id);
+               Cursor i = commitDbAdapter.fetchCommit(id);
                assertEquals(1,
                                i.getInt(i.getColumnIndexOrThrow(CommitDbAdapter.KEY_READ)));
 
+               commitDbAdapter.setReadStatus(id, false);
+               i = commitDbAdapter.fetchCommit(id);
+               assertEquals(0,
+                               i.getInt(i.getColumnIndexOrThrow(CommitDbAdapter.KEY_READ)));
+
+
                commitDbAdapter.deleteCommit(id);
                c.close();
                commitDbAdapter.close();