-
Notifications
You must be signed in to change notification settings - Fork 1
/
cases.txt
132 lines (119 loc) · 3.17 KB
/
cases.txt
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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
Each test case is created in javascript and run from the command line using:
node index.js --dryrun 'test'
--dryrun, -d Run the fetch process but do not attempt to save to the database
and instead print to console, useful for testing.
Test case 1:
Input: parameter: 'pm25',
unit: 'ppq', //Error: Should be ppm
value: 10,
location: 'test1',
coordinates: {
latitude: -20,
longitude: 34
},
country: 'US',
city: 'Test',
sourceName: 'Test',
mobile: false,
sourceType: 'government',
attribution: [{
name: 'test',
url: 'http://test.case'
}],
averagingPeriod: {
value: 1,
unit: 'hours'
}
Expected Output: 'instance.unit is not one of enum values: µg/m³,ppm'
Test case 2:
Input: parameter: '01', //Error: Not a valid parameter
unit: 'ppm',
value: 10,
location: 'test2',
coordinates: {
latitude: -20,
longitude: 34
},
country: 'US',
city: 'Test',
sourceName: 'Test',
mobile: false,
sourceType: 'government',
attribution: [{
name: 'test',
url: 'http://test.case'
}],
averagingPeriod: {
value: 1,
unit: 'hours'
}
Expected Output: 'instance parameter is not one of enum values: pm25,pm10,no2,so2,o3,co,bc'
Test case 3:
Input: parameter: 'no2',
unit: 'ppm',
value: Q, //Error: Value must be a number
location: 'test3',
coordinates: {
latitude: -20,
longitude: 34
},
country: 'US',
city: 'Test',
sourceName: 'Test',
mobile: false,
sourceType: 'government',
attribution: [{
name: 'test',
url: 'http://test.case'
}],
averagingPeriod: {
value: 1,
unit: 'hours'
}
Expected Output: 'instance value is not of a type(s) number'
Test case 4:
Input: parameter: 'pm25', //Ideal case
unit: 'ppm',
value: 10,
location: 'test4',
coordinates: {
latitude: -20,
longitude: 34
},
country: 'US',
city: 'Test',
sourceName: 'Test',
mobile: false,
sourceType: 'government',
attribution: [{
name: 'test',
url: 'http://test.case'
}],
averagingPeriod: {
value: 1,
unit: 'hours'
}
Expected Output: 'Data source accepted.'
Test case 5:
Input: parameter: 'pm25',
unit: 'ppm',
value: 10,
location: 'test5',
coordinates: {
latitude: -20,
longitude: 34
},
country: , //Error: Country field required
city: 'Test',
sourceName: 'Test',
mobile: false,
sourceType: 'government',
attribution: [{
name: 'test',
url: 'http://test.case'
}],
averagingPeriod: {
value: 1,
unit: 'hours'
}
Expected Output: 'instance requires property "country"'