Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/scala/18.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
在ScalaTest中将AsyncWordSpec与PropertyChecks混合_Scala_Asynchronous_Scalatest - Fatal编程技术网

在ScalaTest中将AsyncWordSpec与PropertyChecks混合

在ScalaTest中将AsyncWordSpec与PropertyChecks混合,scala,asynchronous,scalatest,Scala,Asynchronous,Scalatest,我想在ScalaTest中将AsyncWordSpec与属性驱动测试混合使用 到目前为止,我有以下几点: class SQLPersistenceSpec extends AsyncWordSpec with Matchers with EitherValues with PropertyChecks{ ... "SQLPersistence" should { ... "insert an order" in { val persistence = H2Code

我想在ScalaTest中将AsyncWordSpec与属性驱动测试混合使用

到目前为止,我有以下几点:

class SQLPersistenceSpec extends AsyncWordSpec with Matchers with EitherValues with PropertyChecks{

...

  "SQLPersistence" should {

...

    "insert an order" in {
      val persistence = H2CodeRepository(h2URL)

      persistence
        .insertOrder(id, orderedBy, productId, freeOfCharge)
        .map(_.right.value shouldBe 1)
    }
...
我想创建一个基于属性的“insert a order”版本,它将
id
的硬编码值替换为
forAll{id:Int=>…}
构造

不幸的是,
forAll
没有返回
Future[Assertion]
,因此我还没有找到一种方法来组合这两种测试样式

有没有办法将
AsyncWordSpec
PropertyChecks
结合起来