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.
A Expectation[-M, +E, +A] is an immutable data structure that represents
expectations on module M capabilities.
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.
A MockException is used internally by the mock framework to
signal failed expectations to the test framework.
The Mockable[A] represents a mock service builder used by the mock
framework to construct a mock implementation from a mock.
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.
A
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 expectationsThe 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.