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
android { | |
compileSdk 33 | |
defaultConfig { | |
applicationId "com.grishko188.pointofinterest" | |
... | |
testInstrumentationRunner "com.grishko188.pointofinterest.MyAppTestRunner" | |
} | |
} |
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 MyAppTestRunner : AndroidJUnitRunner() { | |
override fun newApplication(cl: ClassLoader?, name: String?, context: Context?): Application { | |
return super.newApplication(cl, HiltTestApplication::class.java.name, context) | |
} | |
} |
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
dependencies { | |
androidTestImplementation 'com.google.dagger:hilt-android-testing:2.44' | |
// ...with Kotlin. | |
kaptAndroidTest 'com.google.dagger:hilt-android-compiler:2.44' | |
// ...with Java. | |
androidTestAnnotationProcessor 'com.google.dagger:hilt-android-compiler:2.44' | |
} |
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
@OptIn(ExperimentalCoroutinesApi::class) | |
class SearchViewModelTest { | |
@Inject | |
lateinit var searchUseCase: SearchPoiUseCase | |
lateinit var SUT: SearchVm | |
@Before | |
fun setup() { |
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
@HiltViewModel | |
class SharingTargetViewModel @Inject constructor( | |
savedStateHandle: SavedStateHandle, | |
... | |
) : ViewModel() { | |
private val sharedContentState = savedStateHandle.getStateFlow(NavController.KEY_DEEP_LINK_INTENT, Intent()) | |
.map { intent -> intent.parseSharedContent() } | |
.map { | |
// map to ui state |
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
<activity | |
android:name=".features.main.MainActivity" | |
android:theme="@style/Theme.AppSplash"> | |
<intent-filter> | |
<action android:name="android.intent.action.MAIN" /> | |
<category android:name="android.intent.category.LAUNCHER" /> | |
</intent-filter> | |
<intent-filter> | |
<action android:name="android.intent.action.SEND" /> | |
<category android:name="android.intent.category.DEFAULT" /> |