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(
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);
null // sort order
);
- validateCursor(cursor, locationTestValues);
+ validateCursor(cursor, locationTestValues);
// Fantastic. Now that we have a location, add some weather!