All Downloads are FREE. Search and download functionalities are using the official Maven repository.

scala-cask.modelTest.mustache Maven / Gradle / Ivy

There is a newer version: 7.9.0
Show newest version
{{>licenseInfo}}
// this model was generated using modelTest.mustache
package {{modelPackage}}
{{#imports}}import {{import}}
{{/imports}}

import org.scalatest.matchers.should.Matchers
import org.scalatest.wordspec.AnyWordSpec
import scala.util.*

{{#models}}
{{#model}}
class {{classname}}Test extends AnyWordSpec with Matchers {

{{#operations}}
    // operation {{classname}}
    //
    {{#examples}}
    key = {{key}}
    value= {{value}}
    {{/examples}}
{{/operations}}
    "{{classname}}.fromJson" should {
        """not parse invalid json""" in {
           val Failure(err) = Try({{classname}}Data.fromJsonString("invalid jason"))
           err.getMessage should startWith ("Error parsing json 'invalid jason'")
        }
        """parse {{example}}""" ignore {
           val Failure(err : ValidationErrors) = {{classname}}Data.fromJsonString("""{{example}}""").validated()

           sys.error("TODO")
        }
    }

}
{{/model}}
{{/models}}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy