-
Notifications
You must be signed in to change notification settings - Fork 7
/
covid_test.go
49 lines (45 loc) · 969 Bytes
/
covid_test.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
package infermedica
import (
"testing"
"github.com/stretchr/testify/assert"
)
func TestApp_CovidDiagnosis(t *testing.T) {
a := GetTestAppInstance()
r := CovidDiagnosisReq{
Sex: SexMale,
Age: 30,
Evidences: []EvidenceCovid{},
}
res, err := a.CovidDiagnosis(r)
assert.NoError(t, err)
assert.NotEmpty(t, res.Question)
}
func TestApp_CovidTriage(t *testing.T) {
a := GetTestAppInstance()
r := CovidDiagnosisReq{
Sex: SexMale,
Age: 30,
Evidences: []EvidenceCovid{
EvidenceCovid{
ID: "s_22",
ChoiceID: EvidenceChoiceIDPresent,
},
EvidenceCovid{
ID: "s_14",
ChoiceID: EvidenceChoiceIDPresent,
},
EvidenceCovid{
ID: "s_2",
ChoiceID: EvidenceChoiceIDPresent,
},
EvidenceCovid{
ID: "p_27",
ChoiceID: EvidenceChoiceIDAbsent,
},
},
}
res, err := a.CovidTriage(r)
assert.NoError(t, err)
assert.NotEmpty(t, res.Serious)
assert.NotEmpty(t, res.TriageLevel)
}