summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorGeorge Mount <mount@google.com>2013-03-07 16:56:23 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2013-03-07 16:56:23 +0000
commit2678d9626f3efc6b0728de52c193598ecef02a8a (patch)
tree0ef1f5e9578a37aff234372c1a4095d88dd00aae /tests
parent74fe1bc1bcbcef4a49eb68b4ef985d80912f7da9 (diff)
parent3360e27e1d0e37f803c10f27257a81b2600b209c (diff)
downloadandroid_packages_apps_Snap-2678d9626f3efc6b0728de52c193598ecef02a8a.zip
android_packages_apps_Snap-2678d9626f3efc6b0728de52c193598ecef02a8a.tar.gz
android_packages_apps_Snap-2678d9626f3efc6b0728de52c193598ecef02a8a.tar.bz2
Merge "Add inserts to PhotoProvider." into gb-ub-photos-bryce
Diffstat (limited to 'tests')
-rw-r--r--tests/src/com/android/photos/data/PhotoProviderTest.java18
1 files changed, 16 insertions, 2 deletions
diff --git a/tests/src/com/android/photos/data/PhotoProviderTest.java b/tests/src/com/android/photos/data/PhotoProviderTest.java
index 2e644a3..927a9d0 100644
--- a/tests/src/com/android/photos/data/PhotoProviderTest.java
+++ b/tests/src/com/android/photos/data/PhotoProviderTest.java
@@ -188,9 +188,23 @@ public class PhotoProviderTest extends ProviderTestCase2<PhotoProvider> {
public void testInsert() {
ContentValues values = new ContentValues();
- values.put(Albums.NAME, "don't add me");
+ values.put(Albums.NAME, "add me");
values.put(Albums.VISIBILITY, Albums.VISIBILITY_PRIVATE);
- assertNull(mResolver.insert(Albums.CONTENT_URI, values));
+ values.put(Albums.ACCOUNT_ID, 100L);
+ values.put(Albums.DATE_MODIFIED, 100L);
+ values.put(Albums.DATE_PUBLISHED, 100L);
+ values.put(Albums.LOCATION_STRING, "Home");
+ values.put(Albums.NAME, "hello world");
+ values.putNull(Albums.PARENT_ID);
+ values.put(Albums.SUMMARY, "Nothing much to say about this");
+ values.put(Albums.TITLE, "Title");
+ Uri insertedUri = mResolver.insert(Albums.CONTENT_URI, values);
+ assertNotNull(insertedUri);
+ Cursor cursor = mResolver.query(insertedUri, PhotoDatabaseUtils.PROJECTION_ALBUMS, null,
+ null, null);
+ assertNotNull(cursor);
+ assertEquals(1, cursor.getCount());
+ cursor.close();
}
public void testUpdate() {