File tree Expand file tree Collapse file tree 1 file changed +31
-0
lines changed
socha-sdk/src/test/sc/shared Expand file tree Collapse file tree 1 file changed +31
-0
lines changed Original file line number Diff line number Diff line change 1+ package sc.shared
2+
3+ import com.thoughtworks.xstream.XStream
4+ import io.kotlintest.specs.StringSpec
5+ import io.kotlintest.inspectors.forAll
6+ import io.kotlintest.shouldBe
7+
8+ class SlotDescriptorTest : StringSpec ({
9+ " convert XML" {
10+ val xstream = XStream ().apply {
11+ setMode(XStream .NO_REFERENCES )
12+ autodetectAnnotations(true)
13+ }
14+ val descriptors = listOf(
15+ SlotDescriptor (),
16+ SlotDescriptor ("Display Name "),
17+ SlotDescriptor ("name", false),
18+ SlotDescriptor ("another name", true, false)
19+ )
20+ val XMLs = listOf(
21+ """<slotDescriptor canTimeout="false" shouldBePaused="false"/>""",
22+ """<slotDescriptor displayName="Display Name " canTimeout="true" shouldBePaused="true"/>""",
23+ """<slotDescriptor displayName="name" canTimeout="false" shouldBePaused="true"/>""",
24+ """<slotDescriptor displayName="another name" canTimeout="true" shouldBePaused="false"/>"""
25+ )
26+
27+ (descriptors zip XMLs ).forAll {
28+ xstream.toXML(it.first) shouldBe it.second
29+ }
30+ }
31+ })
You can’t perform that action at this time.
0 commit comments