No coverage for unit test

Viewed 106

I create a "Basic" app from Android Studio Arctic Fox initial screen. I create SimpleClass and SimpleTest, and the test passes. Then right click the test to run "with coverage". The test passed, Code Coverage says "No coverage for all classes in scope. I have tried Code Coverage runner of Idea and jacoco and both give the same results: Test Configuration `

class SimpleClass(p1: String){
    var a: String
    var b: String
    init {
        a = p1
        b = p1
    }
}

class SimpleTest {
    @Test
    fun testA(){
        val simpleClass = SimpleClass("hello world")
        assert(simpleClass.a  =="hello world", )
        assert(simpleClass.b == "hello world")
    }

in Build.gradle:
buildTypes {
    getByName("debug") {
        this.isTestCoverageEnabled = true
    }
}

` Test coverage result

0 Answers
Related