Files
openide/plugins/coverage-common/testSrc/com/intellij/coverage/view/StateBeanTest.kt
Maksim Zuev 8e90196a7f [coverage] IDEA-353814 Update the filter element's persistent name to reset the filter
GitOrigin-RevId: 31ea4a93304be1c6b51a18d57ef7a2fe5b49b48b
2024-06-18 12:19:22 +00:00

38 lines
948 B
Kotlin

package com.intellij.coverage.view
import com.intellij.util.xmlb.XmlSerializer
import org.junit.jupiter.api.Assertions.*
import org.junit.jupiter.api.Test
internal class StateBeanTest {
@Test
fun `test has constructor with no arguments`() {
CoverageViewManager.StateBean()
}
@Test
fun `test field names are stable`() {
val stateBean = CoverageViewManager.StateBean().apply {
myColumnSize = listOf(1, 2, 3)
}
val element = XmlSerializer.serialize(stateBean)
val names = element.children.map { element ->
if (element.name == "option") {
element.getAttribute("name").value
} else {
element.name
}
}.sorted().joinToString("\n")
assertEquals("""
flattenPackages
hideFullyCovered
myAscendingOrder
myAutoScrollFromSource
myAutoScrollToSource
myColumnSize
mySortingColumn
showOnlyModified_v2
""".trimIndent(), names)
}
}