X-Git-Url: https://git.njae.me.uk/?a=blobdiff_plain;f=app%2Fsrc%2FandroidTest%2Fjava%2Fuk%2Fme%2Fnjae%2Fsunshine%2FTestDb.java;h=86663d3122a4b00bb6c1989a28b9043c0261bf03;hb=HEAD;hp=73353e84bf85be93f80f5ae97b597e70ae3a87ff;hpb=7b993579d6156ccbee09d55ff4b175359e85eb4c;p=Sunshine.git diff --git a/app/src/androidTest/java/uk/me/njae/sunshine/TestDb.java b/app/src/androidTest/java/uk/me/njae/sunshine/TestDb.java index 73353e8..86663d3 100644 --- a/app/src/androidTest/java/uk/me/njae/sunshine/TestDb.java +++ b/app/src/androidTest/java/uk/me/njae/sunshine/TestDb.java @@ -17,6 +17,9 @@ public class TestDb extends AndroidTestCase { public static final String LOG_TAG = TestDb.class.getSimpleName(); + static final String TEST_LOCATION = "99705"; + static final String TEST_DATE = "20141205"; + public void testCreateDb() throws Throwable { mContext.deleteDatabase(WeatherDbHelper.DATABASE_NAME); SQLiteDatabase db = new WeatherDbHelper( @@ -27,12 +30,6 @@ public class TestDb extends AndroidTestCase { public void testInsertReadDb() { - // Test data we're going to insert into the DB to see if it works. - String testLocationSetting = "99705"; - String testCityName = "North Pole"; - double testLatitude = 64.7488; - double testLongitude = -147.353; - // If there's an error in those massive SQL table creation Strings, // errors will be thrown here when you try to get a writable database. WeatherDbHelper dbHelper = new WeatherDbHelper(mContext); @@ -62,7 +59,7 @@ public class TestDb extends AndroidTestCase { null // sort order ); - validateCursor(cursor, locationTestValues); + validateCursor(cursor, locationTestValues); // Fantastic. Now that we have a location, add some weather!