fradrive/test/Handler/Exam/FormSpec.hs
2020-09-18 15:16:55 +02:00

36 lines
826 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
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, showReadLaws ]
lawsCheckHspec (Proxy @ExamPartForm)
[ eqLaws, ordLaws ]