Sha256: a15759ae5d3476b167b227bf14a3d7c4302144b9466d7235b9a30d2720b6eda2

Contents?: true

Size: 992 Bytes

Versions: 68

Compression:

Stored size: 992 Bytes

Contents

import java.io.File

import testgen.TestSuiteBuilder._
import testgen._

object PhoneNumberTestGenerator {
  def fromLabeledTest(argNames: String*): ToTestCaseData =
    withLabeledTest { sut =>
      labeledTest =>
        val args = sutArgsFromInput(labeledTest.result, argNames: _*)
        val property = labeledTest.property
        val sutCall =
          s"""PhoneNumber.$property($args)"""
        val expected = toString(labeledTest.expected)
        TestCaseData(labeledTest.description, sutCall, expected)
    }

  def toString(expected: CanonicalDataParser.Expected): String = {
    expected match {
      case Left(_) => "None"
      case Right(null) => "None"
      case Right(str) => s"""Some("$str")"""
    }
  }

  def main(args: Array[String]): Unit = {
    val file = new File("src/main/resources/phone-number.json")

    val code = TestSuiteBuilder.build(file, fromLabeledTest("phrase"))
    println(s"-------------")
    println(code)
    println(s"-------------")
  }
}

Version data entries

68 entries across 68 versions & 1 rubygems

Version Path
trackler-2.2.1.180 tracks/scala/testgen/src/main/scala/PhoneNumberTestGenerator.scala
trackler-2.2.1.179 tracks/scala/testgen/src/main/scala/PhoneNumberTestGenerator.scala
trackler-2.2.1.178 tracks/scala/testgen/src/main/scala/PhoneNumberTestGenerator.scala
trackler-2.2.1.177 tracks/scala/testgen/src/main/scala/PhoneNumberTestGenerator.scala
trackler-2.2.1.176 tracks/scala/testgen/src/main/scala/PhoneNumberTestGenerator.scala
trackler-2.2.1.175 tracks/scala/testgen/src/main/scala/PhoneNumberTestGenerator.scala
trackler-2.2.1.174 tracks/scala/testgen/src/main/scala/PhoneNumberTestGenerator.scala
trackler-2.2.1.173 tracks/scala/testgen/src/main/scala/PhoneNumberTestGenerator.scala
trackler-2.2.1.172 tracks/scala/testgen/src/main/scala/PhoneNumberTestGenerator.scala
trackler-2.2.1.171 tracks/scala/testgen/src/main/scala/PhoneNumberTestGenerator.scala
trackler-2.2.1.170 tracks/scala/testgen/src/main/scala/PhoneNumberTestGenerator.scala
trackler-2.2.1.169 tracks/scala/testgen/src/main/scala/PhoneNumberTestGenerator.scala
trackler-2.2.1.167 tracks/scala/testgen/src/main/scala/PhoneNumberTestGenerator.scala
trackler-2.2.1.166 tracks/scala/testgen/src/main/scala/PhoneNumberTestGenerator.scala
trackler-2.2.1.165 tracks/scala/testgen/src/main/scala/PhoneNumberTestGenerator.scala
trackler-2.2.1.164 tracks/scala/testgen/src/main/scala/PhoneNumberTestGenerator.scala
trackler-2.2.1.163 tracks/scala/testgen/src/main/scala/PhoneNumberTestGenerator.scala
trackler-2.2.1.162 tracks/scala/testgen/src/main/scala/PhoneNumberTestGenerator.scala
trackler-2.2.1.161 tracks/scala/testgen/src/main/scala/PhoneNumberTestGenerator.scala
trackler-2.2.1.160 tracks/scala/testgen/src/main/scala/PhoneNumberTestGenerator.scala