All Questions
2,040
questions
0
votes
1
answer
46
views
Yet another "No tests found" question (testDebugUnitTest). Did I miss a dependency somewhere? Trying to use JUnit5
I've made my first android app (a very simple button tapper) and am currently trying to create test files for it. I've been following the YouTuber Philipp Lackner and have gotten by pretty well ...
0
votes
0
answers
15
views
Create and write to a real file in JUnit test case
I have a unit test case in Android where I want to create a new file and write data to it. This file needs to be manually analysed later so cannot use TemporaryFolder().
Is there any way to create a ...
0
votes
0
answers
27
views
Android test class with time delay
I'm working on an IdleHandler class in my Android app to handle inactivity. The class looks like this:
class IdleHandler {
object TimerConstants {
const val ...
1
vote
2
answers
124
views
Testing Dispatcher IO and ViewModelScope in Unit Tests
I'm trying to test some code in my viewmodel. I'm trying to make two network calls with dispatcher async, but haven't figured out how to test. This is a simplified example of what I'm essentially ...
0
votes
0
answers
127
views
Kotlin Coroutines Test: UncompletedCoroutinesError - Test Coroutine Not Completing
I'm encountering an UncompletedCoroutinesError while running a Kotlin coroutine test. The specific error message is:
kotlinx.coroutines.test.UncompletedCoroutinesError: After waiting for 1m, the test ...
0
votes
1
answer
32
views
JUnit Testing Multiple Values Against Same Function Best Practice
Say I have various input strings that are passed into the same function and returns output strings that are compared against their expected results. For example, periods should be transformed to ...
1
vote
0
answers
40
views
Android Mockito and JUnit Firebase Auth testing
I'm trying to implement a test in Android using Mockito and JUnit, to Firebase register method (that I did using Dependecy Injection with Hilt)
I received a lot of different erros, and I don't know ...
0
votes
0
answers
26
views
How I can test location service, and it's permissions with junit?
Is it possible to write to write instrumental tests and later on for location permissions? I'm relatively new to testing topic, and I haven't found much examples that could possibly help me with it.
0
votes
0
answers
22
views
Android: Junit test to check/validate file inside Assets folder throw FileNotFoundException
I have abc.json file inside Assets folder of the Android project.
Everything is working in the application. i.e, able to read this file when launching the app on the phone.
Junit test to validate the ...
0
votes
0
answers
21
views
Saving a file artefact from an Android test after a test run
I'm debugging a video encoder app and need to check the produced file on my laptop, not in the emulator. Currently, I'm saving the resulting file to the temporary folder on the Android device, then I ...
0
votes
0
answers
31
views
Android: Test unit is being run twice
Been trying to consolidate unit test report for a multi-module Android project with custom Gradle task using TestReport.
project level build.gradle
tasks.register<TestReport>("testReport&...
0
votes
0
answers
21
views
Android Studio Changed my Modules, and now my Unit Tests are Red all over
I recently upgraded my Android Studio to Hedgehog, and since then, any time I try to edit a unit test, it complains that classes I define within the same module are not able to be found, and it ...
0
votes
1
answer
152
views
Why am I getting a No interface method complete in class CompletableJob Exception
I'm getting this error when running a unit test on a composable:
No interface method complete()Z in class Lkotlinx/coroutines/CompletableJob; or its super classes (declaration of 'kotlinx.coroutines....
0
votes
0
answers
65
views
How to mock internal interface that is provided by Koin?
Currently trying to write a unit test for my view model in the Android app.
The problem is in one of my functions there is a call of the KoinComponent function.
This component contents val that is set ...
1
vote
0
answers
33
views
How can I use JDK packages in Unit tests in Android project?
My project is an Android library, so naturally I have plugins { id 'com.android.library' } in my build.gradle. This has unexpected effect that in unit tests imports like import java.net.http....