mercredi 12 juin 2019

ScalaTest, testing Right[Seq[MyClass]] and properties

I am trying to implement a test with ScalaTest (WordSpecLike, MustMatchers) that verify if an Either[Seq[Error], Seq[Value]] contains one value and if the value has some specific attributes.

Ideally I would like to have something like:

val result:Either[Seq[Error], Seq[Value]] = ...
result.value must contain { _ have (
  'prop ("value")
)}

But this does not compile and I have no clue on how to achieve this kind of matching.

Is there an documentation on deep tests or some best practices for that ?

Thanks

Aucun commentaire:

Enregistrer un commentaire