See first my screenshot
to compare if folders really exist.
You can also go to your windows file explorer in your app folder diceroller/app/src/test/java/com/example/diceroller and see if ExampleUnitTest.kt is there.
Maybe the last 3 folders which is the package folders might not exist.
Honestly i dont know if the package folders and the ExampleUnitTest.kt exist.
Firstly, to be able to create the package folders, create the directory folder, which will have inside, the package folders:

then, double click on "java" folder to create:

Of course do the same for the androidTest folder. Right click on androidTest folder -> New -> Directory. Then double click on "java". Just so you know, the androidTest is the instrumentation test folder and the test folder is the unit test folder.
To create the package folders, right click on "java"->new->package:

then:

and typing on com.example.diceroller and then enter.

If you want, I'll tell you for creating the ExampleUnitTest.kt too.
Sorry if I don't know any button to show the folders and the tests.
Anything you want ask me!
For creating the ExampleUnitTest.kt:
Right click on your created "test" folder -> "New" -> "Kotlin Class/File".
Then name it by typing ExampleUnitTest and enter.
Copy paste this source code to your ExampleUnitTest file:
package com.example.diceroller
import org.junit.Test
import org.junit.Assert.*
/**
* Example local unit test, which will execute on the development machine (host).
*
* See [testing documentation](http://d.android.com/tools/testing).
*/
class ExampleUnitTest {
@Test
fun addition_isCorrect() {
assertEquals(4, 2 + 2)
}
}
Do the same for creating instrumented test file but instead of right clicking on "test" folder, right click on "androidTest" folder -> "New" -> "Kotlin Class/File".
Then name it ExampleInstrumentedTest and enter.
After that copy paste this source code to your ExampleInstrumentedTest file:
package com.example.diceroller
import androidx.test.platform.app.InstrumentationRegistry
import androidx.test.ext.junit.runners.AndroidJUnit4
import org.junit.Test
import org.junit.runner.RunWith
import org.junit.Assert.*
/**
* Instrumented test, which will execute on an Android device.
*
* See [testing documentation](http://d.android.com/tools/testing).
*/
@RunWith(AndroidJUnit4::class)
class ExampleInstrumentedTest {
@Test
fun useAppContext() {
// Context of the app under test.
val appContext = InstrumentationRegistry.getInstrumentation().targetContext
assertEquals("com.example.diceroller", appContext.packageName)
}
}
If you want to save all that, go top left "File"-> "Save All".
All good now? Anything you want, I'm here!