-
Notifications
You must be signed in to change notification settings - Fork 0
/
testUtil.go
49 lines (45 loc) · 996 Bytes
/
testUtil.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 durcov
import "time"
// ExampleTestData returns a mock Data struct with global data and data for 2 countries.
// Inteneded as a testing utility.
func ExampleTestData() (*Data, error) {
exampleTime, err := time.Parse(time.RFC3339, "2020-12-04T03:49:29Z")
if err != nil {
return nil, err
}
exampleData := Data{
&global{
&statistics{
totalConfirmed: 10000000,
totalDeaths: 500000,
totalRecovered: 500000,
date: exampleTime,
},
},
[]*country{
&country{
name: "Afghanistan",
code: "AF",
slug: "afghanistan",
stats: &statistics{
totalConfirmed: 46980,
totalDeaths: 1822,
totalRecovered: 37026,
date: exampleTime,
},
},
&country{
name: "Singapore",
code: "SG",
slug: "singapore",
stats: &statistics{
totalConfirmed: 46980,
totalDeaths: 1822,
totalRecovered: 37026,
date: exampleTime,
},
},
},
}
return &exampleData, nil
}