No error still Android Studio says “no tests were found”

后端 未结 3 662
时光说笑
时光说笑 2020-12-19 05:32

I am trying to write an instrumentation test for my MainActivity. I followed the answers given here. Still Android Studio cannot find any tests. I have the class Application

3条回答
  •  悲哀的现实
    2020-12-19 06:07

    not sure if the problem has been found. Running into similar but only if added assertTrue() it got the "Empty test suite.".

    but replace with assertNotNull() the test is fine, still cannot use assertTrue though (not know why).

    (I'm using kotlin and modify the Android studio generated default test in the AndroidTest folder, and the test is coded in kotlin's companion object, if this make any difference). Update: using assertTrue() outside the companion object is fine.

提交回复
热议问题