keiro-dsl-0.15.0.0: test/conformance-router/Generated/IncidentPaging/ServiceOncall/ReadModelHarness.hs
-- @generated by keiro-dsl 0.15.0.0 (language keiro-dsl 4) from readmodel service_oncall; do not edit.
module Generated.IncidentPaging.ServiceOncall.ReadModelHarness (readModelFacts, readModelFactResults, runReadModelFacts) where
import Generated.IncidentPaging.ServiceOncall.ReadModel (serviceOncallReadModel, serviceOncallAsyncProjection)
import Data.Text qualified as T
import Keiro.ReadModel (ReadModel (..), StrongScope (..))
import Keiro.Projection (AsyncProjection (..))
-- | (fact, expected from notation, actual generated runtime value).
readModelFacts :: [(String, String, String)]
readModelFacts =
[ ("registryName", "incident-paging-service-oncall", T.unpack serviceOncallReadModel.name)
, ("subscriptionName", "incident-paging-service-oncall-sub", T.unpack serviceOncallReadModel.subscriptionName)
, ("shapeHash", "fnv1a:1d7aef5c25b434fd", T.unpack serviceOncallReadModel.shapeHash)
, ("asyncProjectionName", "incident-paging-service-oncall-async", T.unpack serviceOncallAsyncProjection.name)
, ("consistency", "Eventual", show serviceOncallReadModel.defaultConsistency)
, ("strongScope", "EntireLog", renderStrongScope serviceOncallReadModel.strongScope)
]
renderStrongScope :: StrongScope -> String
renderStrongScope EntireLog = "EntireLog"
renderStrongScope (CategoryHead categoryName) = "CategoryHead " <> T.unpack categoryName
readModelFactResults :: [(String, Bool)]
readModelFactResults =
[(fact, expected == actual) | (fact, expected, actual) <- readModelFacts]
runReadModelFacts :: IO Bool
runReadModelFacts = do
let failures = [(fact, expected, actual) | (fact, expected, actual) <- readModelFacts, expected /= actual]
mapM_ (\(fact, expected, actual) -> putStrLn ("FAIL " <> fact <> " expected=" <> show expected <> " actual=" <> show actual)) failures
pure (null failures)