Add CARING examples and coverage

This commit is contained in:
tegwick 2026-05-17 06:05:18 +02:00
parent 49655e40e0
commit 18054bd160
10 changed files with 318 additions and 1 deletions

View file

@ -82,6 +82,15 @@ func TestDecisionAndAuditExamplesParse(t *testing.T) {
if audit.DecisionID != decision.ID {
t.Errorf("Audit.DecisionID = %q; want %q", audit.DecisionID, decision.ID)
}
var exposure api.CaringExposureEvent
loadJSON(t, filepath.Join("..", "..", "examples", "caring", "exposure_event.json"), &exposure)
if exposure.Type != api.ExposureEventSupport {
t.Errorf("Exposure.Type = %q; want X-Support", exposure.Type)
}
if len(exposure.ExposureModes) != 1 || exposure.ExposureModes[0] != api.ExposureModeMasked {
t.Errorf("Exposure.ExposureModes = %v; want [Masked]", exposure.ExposureModes)
}
}
func TestSchemaFilesAreJSON(t *testing.T) {