summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorGeorge Mount <mount@google.com>2013-03-06 17:21:29 -0800
committerGeorge Mount <mount@google.com>2013-03-07 07:28:10 -0800
commit3360e27e1d0e37f803c10f27257a81b2600b209c (patch)
tree2898f58f6e4946ebf38c8e7fa6bc2d2e66354046 /tests
parentb07453fb2522b82a2f2e5f8c98279dfb9b56ec4d (diff)
downloadandroid_packages_apps_Snap-3360e27e1d0e37f803c10f27257a81b2600b209c.zip
android_packages_apps_Snap-3360e27e1d0e37f803c10f27257a81b2600b209c.tar.gz
android_packages_apps_Snap-3360e27e1d0e37f803c10f27257a81b2600b209c.tar.bz2
Add inserts to PhotoProvider.
Change-Id: Ie91df59975d185948c7c2fd96432d311847c3e00
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() {