implicit final class TestLensAnyOps[A] extends AnyVal
- Alphabetic
- By Inheritance
- TestLensAnyOps
- AnyVal
- Any
- Hide All
- Show All
- Public
- Protected
Value Members
- final def !=(arg0: Any): Boolean
- Definition Classes
- Any
- final def ##: Int
- Definition Classes
- Any
- final def ==(arg0: Any): Boolean
- Definition Classes
- Any
- def anything: TestLens[Boolean]
Always returns true as long the chain of preceding transformations has succeeded.
Always returns true as long the chain of preceding transformations has succeeded.
val option: Either[Int, Option[String]] = Right(Some("Cool")) assertTrue(option.is(_.right.some.anything)) // returns true assertTrue(option.is(_.left.anything)) // will fail because of `.left`.
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- def custom[B](customAssertion: CustomAssertion[A, B]): TestLens[B]
Transforms a value with the given CustomAssertion
- def getClass(): Class[_ <: AnyVal]
- Definition Classes
- AnyVal → Any
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- def subtype[Subtype <: A]: TestLens[Subtype]
Transforms a value of some type into the given
Subtype
if possible, otherwise fails.Transforms a value of some type into the given
Subtype
if possible, otherwise fails.sealed trait CustomError case class Explosion(blastRadius: Int) extends CustomError case class Melting(degrees: Double) extends CustomError case class Fulminating(wow: Boolean) extends CustomError val error: CustomError = Melting(100) assertTrue(option.is(_.subtype[Melting]).degrees > 10) // succeeds assertTrue(option.is(_.subtype[Explosion]).blastRadius == 12) // fails
- def toString(): String
- Definition Classes
- Any