-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2 from aliumujib/feature/country_detail
Removed old tests from seed project
- Loading branch information
Showing
8 changed files
with
62 additions
and
273 deletions.
There are no files selected for viewing
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
45 changes: 45 additions & 0 deletions
45
cache/src/test/java/com/aliumujib/countryflags/cache/dao/CountriesDaoTest.kt
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
package com.aliumujib.countryflags.cache.dao | ||
|
||
import androidx.arch.core.executor.testing.InstantTaskExecutorRule | ||
import androidx.room.Room | ||
import com.aliumujib.countryflags.cache.data.CacheDataFactory | ||
import com.aliumujib.countryflags.cache.room.CountriesDB | ||
import org.junit.After | ||
import org.junit.Before | ||
import org.junit.Rule | ||
import org.junit.Test | ||
import org.junit.runner.RunWith | ||
import org.robolectric.RobolectricTestRunner | ||
import org.robolectric.RuntimeEnvironment | ||
|
||
@RunWith(RobolectricTestRunner::class) | ||
class CountriesDaoTest { | ||
|
||
@Rule | ||
@JvmField var instantTaskExecutorRule = InstantTaskExecutorRule() | ||
|
||
private lateinit var database: CountriesDB | ||
|
||
@Before | ||
fun setUp() { | ||
database = Room.inMemoryDatabaseBuilder( | ||
RuntimeEnvironment.application.applicationContext, | ||
CountriesDB::class.java) | ||
.allowMainThreadQueries().build() | ||
} | ||
|
||
@Test | ||
fun `check that calling getAllCountries() on dao returns data`() { | ||
val countryCacheModel = CacheDataFactory.makeCountryCacheModelList(10) | ||
database.countriesDao().save(countryCacheModel) | ||
|
||
val testObserver = database.countriesDao().getAllCountries().test() | ||
testObserver.assertValue(countryCacheModel) | ||
} | ||
|
||
|
||
@After | ||
fun tearDown() { | ||
database.close() | ||
} | ||
} |
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
76 changes: 0 additions & 76 deletions
76
mobile-ui/src/test/java/com/aliumujib/countryflags/PresentationDataFactory.kt
This file was deleted.
Oops, something went wrong.
6 changes: 6 additions & 0 deletions
6
mobile-ui/src/test/java/com/aliumujib/countryflags/UIDataFactory.kt
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
package com.aliumujib.countryflags | ||
|
||
object UIDataFactory { | ||
|
||
|
||
} |
97 changes: 0 additions & 97 deletions
97
...est/java/com/aliumujib/countryflags/viewmodels/CheckIfCountryIsBookmarkedViewModelTest.kt
This file was deleted.
Oops, something went wrong.
97 changes: 0 additions & 97 deletions
97
...-ui/src/test/java/com/aliumujib/countryflags/viewmodels/FetchAllCountriesViewModelTest.kt
This file was deleted.
Oops, something went wrong.
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