Assert commit date
authorReto Buerki <reet@codelabs.ch>
Thu, 22 Mar 2012 20:06:35 +0000 (21:06 +0100)
committerReto Buerki <reet@codelabs.ch>
Thu, 22 Mar 2012 20:06:35 +0000 (21:06 +0100)
src/ch/codelabs/gitter/test/CommitDbAdapterTest.java

index 5f7364f..efe7086 100644 (file)
@@ -37,6 +37,7 @@ public class CommitDbAdapterTest extends AndroidTestCase {
        public void testInsertCommit() {
                final String testHash1 = "c669e1928dec2a9251a819ca40f32beed9e280ec";
                final String testMail = "doe@example.com";
+               final String testDate = "Thu Mar 22 21:04:37 CET 2012";
                final CommitDbAdapter commitDbAdapter = new CommitDbAdapter(
                                getContext());
                commitDbAdapter.open();
@@ -45,6 +46,7 @@ public class CommitDbAdapterTest extends AndroidTestCase {
                commit.mTitle = "Update TODO";
                commit.mCommitId = testHash1;
                commit.mAuthor = "John Doe";
+               commit.mDate = testDate;
                commit.mEmail = testMail;
                commit.mDiffLink = "http://1.com/abc";
                commit.mContent = "testdata";
@@ -63,6 +65,8 @@ public class CommitDbAdapterTest extends AndroidTestCase {
                                c.getString(c.getColumnIndexOrThrow(CommitDbAdapter.KEY_TITLE)));
                assertEquals("John Doe", c.getString(c
                                .getColumnIndexOrThrow(CommitDbAdapter.KEY_AUTHOR)));
+               assertEquals(testDate,
+                               c.getString(c.getColumnIndexOrThrow(CommitDbAdapter.KEY_DATE)));
                assertEquals(testMail,
                                c.getString(c.getColumnIndexOrThrow(CommitDbAdapter.KEY_EMAIL)));
                assertEquals("http://1.com/abc", c.getString(c