package mock
- Alphabetic
- Public
- Protected
Type Members
- final case class ArgumentExpectation[M, I, A](method: Method[M, I, A], assertion: Assertion[I]) extends Product with Serializable
An
ArgumentExpectation[M, I, A]represents an expectation on inputIarguments for capability of moduleMthat returns an effect that may produce a singleA. - sealed trait Expectation[-M, +E, +A] extends AnyRef
An
Expectation[-M, +E, +A]is an immutable data structure that represents expectations on moduleMcapabilities.An
Expectation[-M, +E, +A]is an immutable data structure that represents expectations on moduleMcapabilities.This structure is a monad, because we need the sequential composability and in Scala we get the convenient for-comprehension syntax for free.
Emptymodels expectation for no calls, the monadicunitvalueCallmodels a call onMmodules capability that takes argumentsIand returns an effect that may fail with an errorEor produce a singleAFlatMapmodels 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
managedEnvmethod or via implicit conversion. - trait Method[M, I, A] extends AnyRef
A
Model[M, I, A]represents a capability of moduleMthat takes an inputIand returns an effect that may produce a singleA. - trait Mock extends AnyRef
- trait MockClock extends Clock
- trait MockConsole extends Console
- sealed trait MockException extends Throwable
A
MockExceptionis used internally by the mock framework to signal failed expectations to the test framework. - trait MockRandom extends Random
- trait MockSystem extends System
- trait Mockable[A] extends AnyRef
The
Mockable[A]represents a mock service builder used by the mock framework to construct a mock implementation from a mock. - sealed trait ReturnExpectation[-I, +E, +A] extends AnyRef
A
ReturnExpectation[-I, E, +A]represents an expectation on output for capability of moduleMthat given input argumentsIreturns an effect that may fail with an errorEor produce a singleA.
Value Members
- object Expectation
- object Mock
- object MockClock extends Serializable
- object MockConsole extends Serializable
- object MockException extends Serializable
- object MockRandom extends Serializable
- object MockSystem extends Serializable
- object ReturnExpectation