mirror of
https://github.com/melihaksoy/Android-Kotlin-Modulerized-CleanArchitecture.git
synced 2026-03-22 09:29:49 +01:00
Dependency upgrades, running on AS 4.1
This commit is contained in:
@@ -20,6 +20,10 @@ class DetailViewModel @Inject constructor(
|
||||
val rocketName = map(successData) {
|
||||
it.rocketName
|
||||
}
|
||||
get() {
|
||||
loadData()
|
||||
return field
|
||||
}
|
||||
|
||||
val description = map(successData) {
|
||||
it.missionDescription
|
||||
@@ -30,10 +34,6 @@ class DetailViewModel @Inject constructor(
|
||||
}
|
||||
//endregion
|
||||
|
||||
init {
|
||||
loadData()
|
||||
}
|
||||
|
||||
//region Functions
|
||||
|
||||
/**
|
||||
|
||||
@@ -8,7 +8,7 @@ import kotlinx.coroutines.test.setMain
|
||||
import org.junit.jupiter.api.AfterEach
|
||||
import org.junit.jupiter.api.BeforeEach
|
||||
|
||||
@UseExperimental(ExperimentalCoroutinesApi::class)
|
||||
@OptIn(ExperimentalCoroutinesApi::class)
|
||||
abstract class BaseTestWithMainThread {
|
||||
|
||||
protected val dispatcher = TestCoroutineDispatcher()
|
||||
|
||||
@@ -22,7 +22,6 @@ import org.junit.jupiter.api.Test
|
||||
*
|
||||
* See [testing documentation](http://d.android.com/tools/testing).
|
||||
*/
|
||||
@UseExperimental(ExperimentalCoroutinesApi::class)
|
||||
class DetailViewModelTest : BaseTestWithMainThread() {
|
||||
|
||||
private val getLaunchDetails: GetLaunchDetails<LaunchDetailItem> = mockk(relaxed = true)
|
||||
|
||||
@@ -14,6 +14,7 @@ import com.melih.launches.data.LaunchItem
|
||||
import com.melih.launches.databinding.LaunchesBinding
|
||||
import com.melih.launches.ui.adapters.LaunchesAdapter
|
||||
import com.melih.launches.ui.vm.LaunchesViewModel
|
||||
import javax.inject.Inject
|
||||
|
||||
class LaunchesFragment : BaseDaggerFragment<LaunchesBinding>(), SwipeRefreshLayout.OnRefreshListener {
|
||||
|
||||
|
||||
@@ -16,7 +16,6 @@ class LaunchesPagingSource @Inject constructor(
|
||||
|
||||
//region Functions
|
||||
|
||||
@UseExperimental(ExperimentalCoroutinesApi::class)
|
||||
override fun loadDataForPage(page: Int) =
|
||||
getLaunches(
|
||||
getLaunchesParams.copy(
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
@file:UseExperimental(ExperimentalCoroutinesApi::class)
|
||||
|
||||
package com.melih.launches
|
||||
|
||||
import kotlinx.coroutines.Dispatchers
|
||||
@@ -10,7 +8,7 @@ import kotlinx.coroutines.test.setMain
|
||||
import org.junit.jupiter.api.AfterEach
|
||||
import org.junit.jupiter.api.BeforeEach
|
||||
|
||||
@UseExperimental(ExperimentalCoroutinesApi::class)
|
||||
@OptIn(ExperimentalCoroutinesApi::class)
|
||||
abstract class BaseTestWithMainThread {
|
||||
|
||||
protected val dispatcher = TestCoroutineDispatcher()
|
||||
|
||||
Reference in New Issue
Block a user