Package

zio.test

mock

Permalink

package mock

Visibility
  1. Public
  2. All

Type Members

  1. final case class ArgumentExpectation[M, I, A](method: Method[M, I, A], assertion: Assertion[I]) extends Product with Serializable

    Permalink

    An ArgumentExpectation[M, I, A] represents an expectation on input I arguments for capability of module M that returns an effect that may produce a single A.

  2. sealed trait Expectation[-M, +E, +A] extends AnyRef

    Permalink

    A Expectation[-M, +E, +A] is an immutable data structure that represents expectations on module M capabilities.

    A Expectation[-M, +E, +A] is an immutable data structure that represents expectations on module M capabilities.

    This structure is a monad, because we need the sequential composability and in Scala we get the convenient for-comprehension syntax for free.

    • Empty models expectation for no calls, the monadic unit value
    • Call models a call on M modules capability that takes arguments I and returns an effect that may fail with an error E or produce a single A
    • FlatMap models sequential composition of expectations

    The whole structure is not supposed to be consumed directly by the end user, instead it should be converted into a mocked environment (wrapped in Managed) either explicitly via managedEnv method or via implicit conversion.

  3. trait Method[M, I, A] extends AnyRef

    Permalink

    A Model[M, I, A] represents a capability of module M that takes an input I and returns an effect that may produce a single A.

  4. trait Mock extends AnyRef

    Permalink
  5. trait MockClock extends Clock

    Permalink
  6. trait MockConsole extends Console

    Permalink
  7. sealed trait MockException extends Throwable

    Permalink

    A MockException is used internally by the mock framework to signal failed expectations to the test framework.

  8. trait MockRandom extends Random

    Permalink
  9. trait MockSystem extends System

    Permalink
  10. trait Mockable[A] extends AnyRef

    Permalink

    The Mockable[A] represents a mock service builder used by the mock framework to construct a mock implementation from a mock.

  11. sealed trait ReturnExpectation[-I, +E, +A] extends AnyRef

    Permalink

    A ReturnExpectation[-I, E, +A] represents an expectation on output for capability of module M that given input arguments I returns an effect that may fail with an error E or produce a single A.

Value Members

  1. object Expectation

    Permalink
  2. object Mock

    Permalink
  3. object MockClock extends Serializable

    Permalink
  4. object MockConsole extends Serializable

    Permalink
  5. object MockException extends Serializable

    Permalink
  6. object MockRandom extends Serializable

    Permalink
  7. object MockSystem extends Serializable

    Permalink
  8. object ReturnExpectation

    Permalink

Ungrouped