Search in sources :

Example 1 with DistrictsTable

use of com.thebluealliance.androidclient.database.tables.DistrictsTable in project the-blue-alliance-android by the-blue-alliance.

the class DatabaseMocker method mockDistrictsTable.

public static DistrictsTable mockDistrictsTable(Database database) {
    SQLiteDatabase db = mock(SQLiteDatabase.class);
    DistrictsTable table = new DistrictsTable(db, TBAAndroidModule.getGson());
    when(database.getDistrictsTable()).thenReturn(table);
    when(database.getWritableDatabase()).thenReturn(db);
    return table;
}
Also used : DistrictsTable(com.thebluealliance.androidclient.database.tables.DistrictsTable) SQLiteDatabase(android.database.sqlite.SQLiteDatabase)

Example 2 with DistrictsTable

use of com.thebluealliance.androidclient.database.tables.DistrictsTable in project the-blue-alliance-android by the-blue-alliance.

the class DatabaseMocker method mockEventsTable.

public static EventsTable mockEventsTable(Database database) {
    SQLiteDatabase db = mock(SQLiteDatabase.class);
    DistrictsTable districtsTable = new DistrictsTable(db, TBAAndroidModule.getGson());
    EventsTable table = new EventsTable(db, TBAAndroidModule.getGson(), districtsTable);
    when(database.getEventsTable()).thenReturn(table);
    when(database.getWritableDatabase()).thenReturn(db);
    return table;
}
Also used : DistrictsTable(com.thebluealliance.androidclient.database.tables.DistrictsTable) SQLiteDatabase(android.database.sqlite.SQLiteDatabase) EventsTable(com.thebluealliance.androidclient.database.tables.EventsTable)

Aggregations

SQLiteDatabase (android.database.sqlite.SQLiteDatabase)2 DistrictsTable (com.thebluealliance.androidclient.database.tables.DistrictsTable)2 EventsTable (com.thebluealliance.androidclient.database.tables.EventsTable)1