This repository has been archived on 2024-10-24. You can view files and clone it, but cannot push or open issues or pull requests.
fradrive-old/test/Handler/Exam/FormSpec.hs
2020-11-19 14:25:38 +01:00

37 lines
830 B
Haskell

module Handler.Exam.FormSpec where
import TestImport
import ModelSpec ()
import CryptoID
import Handler.Exam.Form
instance Arbitrary ExamOccurrenceForm where
arbitrary = ExamOccurrenceForm
<$> (fmap (view _2) <$> (arbitrary :: Gen (Maybe (ExamOccurrenceId, CryptoUUIDExamOccurrence))))
<*> arbitrary
<*> arbitrary
<*> arbitrary
<*> arbitrary
<*> arbitrary
<*> arbitrary
<*> arbitrary
instance Arbitrary ExamPartForm where
arbitrary = ExamPartForm
<$> (fmap (view _2) <$> (arbitrary :: Gen (Maybe (ExamPartId, CryptoUUIDExamPart))))
<*> arbitrary
<*> arbitrary
<*> arbitrary
<*> arbitrary
spec :: Spec
spec = do
parallel $ do
lawsCheckHspec (Proxy @ExamOccurrenceForm)
[ eqLaws, ordLaws ]
lawsCheckHspec (Proxy @ExamPartForm)
[ eqLaws, ordLaws ]