| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Test.MockCat.Internal.Types
Synopsis
- data InvocationRecorder params = InvocationRecorder {
- invocationRef :: TVar (InvocationRecord params)
- functionNature :: FunctionNature
- data BuiltMock fn params = BuiltMock {
- builtMockFn :: fn
- builtMockRecorder :: InvocationRecorder params
- data FunctionNature
- type InvocationList params = [params]
- type InvocationCounts params = AssociationList params Int
- data InvocationRecord params = InvocationRecord {
- invocations :: InvocationList params
- invocationCounts :: InvocationCounts params
- data CountVerifyMethod
- newtype Cases a b = Cases (State [a] b)
- newtype VerifyFailed = VerifyFailed Message
- data VerifyOrderMethod
- data VerifyOrderResult a = VerifyOrderResult {
- index :: Int
- calledValue :: a
- expectedValue :: a
- type Message = String
- data VerifyMatchType a
- type MockName = String
- safeIndex :: [a] -> Int -> Maybe a
- perform :: IO a -> a
Documentation
data InvocationRecorder params Source #
Constructors
| InvocationRecorder | |
Fields
| |
data BuiltMock fn params Source #
Result of building a mock: function plus its recorder.
Constructors
| BuiltMock | |
Fields
| |
data FunctionNature Source #
Constructors
| PureConstant | |
| IOConstant | |
| ParametricFunction |
Instances
| Show FunctionNature Source # | |
Defined in Test.MockCat.Internal.Types Methods showsPrec :: Int -> FunctionNature -> ShowS # show :: FunctionNature -> String # showList :: [FunctionNature] -> ShowS # | |
| Eq FunctionNature Source # | |
Defined in Test.MockCat.Internal.Types Methods (==) :: FunctionNature -> FunctionNature -> Bool # (/=) :: FunctionNature -> FunctionNature -> Bool # | |
type InvocationList params = [params] Source #
type InvocationCounts params = AssociationList params Int Source #
data InvocationRecord params Source #
Constructors
| InvocationRecord | |
Fields
| |
Instances
| Show params => Show (InvocationRecord params) Source # | |
Defined in Test.MockCat.Internal.Types Methods showsPrec :: Int -> InvocationRecord params -> ShowS # show :: InvocationRecord params -> String # showList :: [InvocationRecord params] -> ShowS # | |
| Eq params => Eq (InvocationRecord params) Source # | |
Defined in Test.MockCat.Internal.Types Methods (==) :: InvocationRecord params -> InvocationRecord params -> Bool # (/=) :: InvocationRecord params -> InvocationRecord params -> Bool # | |
data CountVerifyMethod Source #
Constructors
| Equal Int | |
| LessThanEqual Int | |
| GreaterThanEqual Int | |
| LessThan Int | |
| GreaterThan Int |
Instances
| Show CountVerifyMethod Source # | |
Defined in Test.MockCat.Internal.Types Methods showsPrec :: Int -> CountVerifyMethod -> ShowS # show :: CountVerifyMethod -> String # showList :: [CountVerifyMethod] -> ShowS # | |
Instances
| Applicative (Cases a) Source # | |
| Functor (Cases a) Source # | |
| Monad (Cases a) Source # | |
| (ParamConstraints params args r, BuildCurried args r fn, BuildCurriedPure args r fn) => StubBuilder (Cases params ()) fn Source # | Overlapping instance for building a mock for a function with multiple parameters.
This instance is used when the parameter type is a |
| (ParamConstraints params args r, BuildCurried args r fn) => MockBuilder (Cases params ()) fn args Source # | Overlapping instance for building a stub when parameters are provided as |
| (ParamConstraints params args r, BuildCurriedIO args r fn) => MockIOBuilder (Cases params ()) fn args Source # | |
| StubBuilder (Cases (IO a) ()) (IO a) Source # | Instance for building a mock for a function with multiple parameters. |
| MockBuilder (Cases (IO a) ()) (IO a) () Source # | Instance for building a stub for `Cases (IO a) ()`. |
newtype VerifyFailed Source #
Constructors
| VerifyFailed Message |
data VerifyOrderMethod Source #
Constructors
| ExactlySequence | |
| PartiallySequence |
data VerifyOrderResult a Source #
Constructors
| VerifyOrderResult | |
Fields
| |
data VerifyMatchType a Source #