Describe the bug
The code at the back has been covered, but the previous sentence has not been covered
Expected behavior
This is the ut code:
@test
fun test add and remove callback
() {
val helper = XMLYMediaBrowserHelper()
val callback = mockk<XMLYMediaBrowserHelper.Callback>()
helper.addCallback(callback)
val callbacks = getPrivateField(helper, "callbacks").get(helper) as List<*>
assert(callbacks.contains(callback))
//again and assert
helper.addCallback(callback)
assert(callbacks.size == 1)
//remove
helper.removeCallback(callback)
assert(!callbacks.contains(callback))
}
Reports
Environment
- Kover Gradle Plugin version: 0.9.2
- Gradle version: 8.11.1
- Kotlin project type: Kotlin/Android