thanksforallthefish
03/25/2021, 1:51 PMimport io.kotest.core.datatest.forAll
import io.kotest.core.spec.style.StringSpec
import io.kotest.data.Row2
import io.kotest.data.row
import io.kotest.matchers.shouldBe
class ParticipantRoleTest : StringSpec({
  "create from string" {
    forAll<Row2<String, *>>(
      "DamageCauser" to row("DamageCauser", ParticipantRole.DamagingParty),
      "Customer" to row("Customer", ParticipantRole.PolicyHolder),
      "Unknown" to row("Unknown", ParticipantRole.Other),
      "Repairer" to row("Repairer", ParticipantRole.Repairer),
    ) { (input, output) ->
      ParticipantRole.fromString(input) shouldBe output
    }
  }
})import io.kotest.core.datatest.forAll
import io.kotest.core.spec.style.FunSpec
import io.kotest.data.Row2
import io.kotest.data.row
import io.kotest.matchers.shouldBe
class ParticipantRoleTest : FunSpec({
  context("create from string") {
    forAll<Row2<String, *>>(
      "DamageCauser" to row("DamageCauser", ParticipantRole.DamagingParty),
      "Customer" to row("Customer", ParticipantRole.PolicyHolder),
      "Unknown" to row("Unknown", ParticipantRole.Other),
      "Repairer" to row("Repairer", ParticipantRole.Repairer),
    ) { (input, output) ->
      ParticipantRole.fromString(input) shouldBe output
    }
  }
})thanksforallthefish
03/25/2021, 1:53 PMimport io.kotest.core.datatest.forAll
import io.kotest.core.spec.style.FunSpec
import io.kotest.data.Row2
import io.kotest.data.row
import io.kotest.matchers.shouldBe
class ParticipantRoleTest : FunSpec({
  test("create from string") {
    forAll<Row2<String, *>>(
      "DamageCauser" to row("DamageCauser", ParticipantRole.DamagingParty),
      "Customer" to row("Customer", ParticipantRole.PolicyHolder),
      "Unknown" to row("Unknown", ParticipantRole.Other),
      "Repairer" to row("Repairer", ParticipantRole.Repairer),
    ) { (input, output) ->
      ParticipantRole.fromString(input) shouldBe output
    }
  }
})