Consider the below example
@Singleton
class LoginModel @Inject contractor(private val userModel:UserModel){
}
@Config(application = HiltTestApplication::class)
@HiltAndroidTest
class LoginModelTest {
@get:Rule
var hiltRule = HiltAndroidRule(this)
@Inject
lateinit var loginModel: LoginModel
@Before
open fun setup() {
hiltRule.inject()
}
}
How to mock UserModel inside the LoginModel without manually constructing LoginModel?