I request a little help with this problem. I'm doing this tutorial to refresh memory and update my knowledge with new state of the art "Developing Android Apps with Kotlin".
https://classroom.udacity.com/courses/ud9012
On class 6, lesson 10, there is this source code: https://github.com/udacity/andfun-kotlin-sleep-tracker/tree/Step.03-Solution-Create-RoomDatabase
@Test
@Throws(Exception::class)
fun insertAndGetNight() {
val night = SleepNight()
sleepDao.insert(night)
val tonight = sleepDao.getTonight()
assertEquals(tonight?.sleepQuality, -1)
}
Supposedly, it should pass a test, but after executing it, it returns this:
Test Passed: 0 passed.
And in the terminal of the right I can read this:
Running tests
$ adb shell am instrument -w -m -e debug false -e class 'com.example.android.trackmysleepquality.SleepDatabaseTest#insertAndGetNight' com.example.android.trackmysleepquality.test/android.test.InstrumentationTestRunner
"Run Android instrumented tests using Gradle" option was ignored because this module type is not supported yet.
What is wrong with the project and why the test is not passed?
I added a text manually writing it, and the result is the same, 0 test passed. This is the test I added:
@Test
fun addition_isCorrect() {
assertEquals(4, 2 + 2)
}
Also, I tried unchecking the box next to Run Android instrumented tests using Gradle in the testing settings (Go to File>>Settings>>Testing) with same result.