Skip to main content
The 2024 Developer Survey results are live! See the results

All Questions

Tagged with
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 ...
zecuse's user avatar
  • 167
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 ...
Bigbrain Ammamma's user avatar
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 ...
James Ostevik's user avatar
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 ...
keyboard_user's user avatar
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 ...
Kotiswar Kaithepalli's user avatar
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 ...
BobDidley's user avatar
  • 123
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 ...
Mateus Camillo's user avatar
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.
SmierdzoncaRobotaEhhh's user avatar
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 ...
Vinit ...'s user avatar
  • 1,459
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 ...
Ivan Nikitin's user avatar
  • 4,046
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&...
Bitwise DEVS's user avatar
  • 3,156
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 ...
Dan Fawaz's user avatar
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....
coder's user avatar
  • 6,115
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 ...
Jhon Farell's user avatar
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....
JBM's user avatar
  • 2,944

15 30 50 per page
1
2 3 4 5
136