Adapt DB test to commit class API change
authorReto Buerki <reet@codelabs.ch>
Thu, 22 Mar 2012 19:49:37 +0000 (20:49 +0100)
committerReto Buerki <reet@codelabs.ch>
Thu, 22 Mar 2012 19:49:37 +0000 (20:49 +0100)
src/ch/codelabs/gitter/test/CommitDbAdapterTest.java

index f556f81..5f7364f 100644 (file)
@@ -19,6 +19,7 @@ package ch.codelabs.gitter.test;
 import android.database.Cursor;
 import android.test.AndroidTestCase;
 
+import ch.codelabs.gitter.Commit;
 import ch.codelabs.gitter.CommitDbAdapter;
 
 public class CommitDbAdapterTest extends AndroidTestCase {
@@ -40,8 +41,15 @@ public class CommitDbAdapterTest extends AndroidTestCase {
                                getContext());
                commitDbAdapter.open();
 
-               long id = commitDbAdapter.insertCommit("Update TODO", testHash1,
-                               "John Doe", testMail, "http://1.com/abc", "testdata");
+               Commit commit = new Commit();
+               commit.mTitle = "Update TODO";
+               commit.mCommitId = testHash1;
+               commit.mAuthor = "John Doe";
+               commit.mEmail = testMail;
+               commit.mDiffLink = "http://1.com/abc";
+               commit.mContent = "testdata";
+
+               long id = commitDbAdapter.insertCommit(commit);
 
                final Cursor c = commitDbAdapter.fetchAllCommits();
                assertTrue(c.getCount() > 0);
@@ -78,8 +86,8 @@ public class CommitDbAdapterTest extends AndroidTestCase {
 
                /* Test latest commit getter, insert another commit first */
                final String testHash2 = "abca3c29b985d90f271c7b9ea9f095729759799c";
-               id = commitDbAdapter.insertCommit("Update TODO", testHash2, "John Doe",
-                               testMail, "http://1.com/abc", "testdata");
+               commit.mCommitId = testHash2;
+               id = commitDbAdapter.insertCommit(commit);
                i = commitDbAdapter.getLatestCommit();
                assertTrue(i.getCount() == 1);
                assertEquals(testHash2,