This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.lukasdylan.dicoding.made | |
import androidx.arch.core.executor.testing.InstantTaskExecutorRule | |
import com.lukasdylan.dicoding.made.model.Discover | |
import com.lukasdylan.dicoding.made.model.DiscoverListResponse | |
import com.lukasdylan.dicoding.made.repository.DiscoverRepositoryImpl | |
import com.lukasdylan.dicoding.made.service.ApiService | |
import com.lukasdylan.dicoding.made.utils.ErrorWrapper | |
import com.lukasdylan.dicoding.made.utils.TestDispatcherProvider | |
import com.lukasdylan.dicoding.made.viewmodel.DiscoverViewModel |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.lukasdylan.dicoding.made.utils | |
import androidx.annotation.VisibleForTesting | |
import kotlinx.coroutines.CoroutineDispatcher | |
import kotlinx.coroutines.Dispatchers | |
import kotlinx.coroutines.ExperimentalCoroutinesApi | |
interface DispatcherProvider { | |
val main: CoroutineDispatcher | |
val background: CoroutineDispatcher |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<androidx.coordinatorlayout.widget.CoordinatorLayout | |
android:id="@+id/root_layout" | |
android:layout_width="match_parent" | |
android:layout_height="match_parent" | |
android:fitsSystemWindows="true"> | |
<com.google.android.material.appbar.AppBarLayout | |
android:id="@+id/app_bar_layout" | |
android:layout_width="match_parent" | |
android:layout_height="wrap_content" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class DatabaseHelper(context: Context) : ManagedSQLiteOpenHelper(context, | |
DatabaseConstant.DATABASE_NAME, null, DatabaseConstant.DATABASE_VERSION) { | |
override fun onCreate(database: SQLiteDatabase?) { | |
database?.createTable(DetailEventResponse.TABLE_NAME, true, | |
DetailEventResponse.EVENT_ID to TEXT + PRIMARY_KEY, | |
DetailEventResponse.HOME_TEAM_ID to TEXT, | |
DetailEventResponse.AWAY_TEAM_ID to TEXT, | |
DetailEventResponse.HOME_TEAM_NAME to TEXT, | |
DetailEventResponse.AWAY_TEAM_NAME to TEXT, |