Skip to content

Commit

Permalink
Use empty application for Robolectric tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
UweTrottmann committed Sep 16, 2020
1 parent f88fcb7 commit a1fd4db
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
package com.battlelancer.seriesguide

import android.app.Application

/**
* Empty [Application] to use with Robolectric @Config to avoid errors
* with components that require an actual device to initialize.
*/
class EmptyTestApplication : Application()
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
package com.battlelancer.seriesguide.thetvdbapi

import com.battlelancer.seriesguide.EmptyTestApplication
import com.google.common.truth.Truth.assertThat
import org.junit.Test
import org.junit.runner.RunWith
import org.robolectric.RobolectricTestRunner
import org.robolectric.annotation.Config

@RunWith(RobolectricTestRunner::class)
@Config(application = EmptyTestApplication::class)
class TvdbImageToolsTest {

@Test
Expand Down

0 comments on commit a1fd4db

Please sign in to comment.