method-0.4.0.0: rebindable methods for improving testability
Safe HaskellNone
LanguageHaskell2010

Test.Method.Behavior

Synopsis

Documentation

class Behave x where Source #

A type class whose behavior is specified by a method

Associated Types

type Condition x Source #

Type of the first argument of thenMethod, representing the condition when the method is called

type MethodOf x Source #

Type of the second argument of thenMethod, representing a method to be called.

Methods

thenMethod :: Condition x -> MethodOf x -> x Source #

Specify behavior from a pair of a condition and a method.

Instances

Instances details
a ~ () => Behave (MockM method a) Source # 
Instance details

Defined in Test.Method.Mock

Associated Types

type Condition (MockM method a) Source #

type MethodOf (MockM method a) Source #

Methods

thenMethod :: Condition (MockM method a) -> MethodOf (MockM method a) -> MockM method a Source #

Behave (Call f m) Source # 
Instance details

Defined in Test.Method.Protocol

Associated Types

type Condition (Call f m) Source #

type MethodOf (Call f m) Source #

Methods

thenMethod :: Condition (Call f m) -> MethodOf (Call f m) -> Call f m Source #

thenReturn :: (Behave x, Method (MethodOf x)) => Condition x -> Ret (MethodOf x) -> x Source #

Specify behavior that return a constant value for a call

thenAction :: (Behave x, Method (MethodOf x)) => Condition x -> Base (MethodOf x) (Ret (MethodOf x)) -> x Source #

Specify behavior that executes an action for a call