-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTestsDocumentation.txt
More file actions
307 lines (297 loc) · 15 KB
/
TestsDocumentation.txt
File metadata and controls
307 lines (297 loc) · 15 KB
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
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
Implementation:
- => not implemented
+ => implemented
! => bug found
All
e - No Authorization header (returns 401 Unauthorized)
e - Wrong JWT token (returns 401 Unauthorized)
Account
1. Get
- Valid id for existing account (returns AccountDto in body and 200 Ok)
- Everything correct request from other player (returns AccountDto in body and 200 Ok)
- Valid id for not existing account (returns 404 Not Found)
- Not valid id (returns 400 Bad Request)
2. Post
- Valid json (returns location header and 201 Created)
- Create second account for one player (returns 409 Conflict)
3. Put
- Everything correct (returns 200 Ok)
- Everything correct given only specific fields (returns 200 Ok)
- Wrong email format (returns 400 Bad Request)
- Email is occupied (returns 400 Bad Request)
- Password is too short (returns 400 Bad Request)
- Account does not exist (returns 404 Not Found)
4. Delete
- Everything correct (returns 204 No Content)
- Account does not exist (returns 404 Not Found)
- Id from route is not int type (returns 400 Bad Request)
Player
1. Get
- Everything correct (returns PlayerDto in body and 200 Ok)
- Everything correct request from other player in the same room (returns PlayerDto in body and 200 Ok)
- request from player that is not in the same room (returns 403 Forbidden)
- Player does not exist (returns 404 Not Found)
- Id from route is not int type (returns 400 Bad Request)
2. Post (Anonymous)
- Everything correct (returns location header and 201 Created)
- Name is empty (returns 400 Bad Request)
- Name is too long (returns 400 Bad Request)
3. Put
- Everything correct (returns 200 Ok)
- Everything correct given only specific fields (returns 200 Ok)
- Name is too long (returns 400 Bad Request)
- IsDead is not bool type
4. Patch (Player Join Room)
- Everything correct (returns 200 Ok)
- Room does not exist (returns 404 Not Found)
- JoinCode wrong format (returns 400 Bad Request)
- Wrong password (returns 403 Forbidden)
- Room is full (returns 403 Forbidden)
5. Patch (Player Leave Room)
- Everything correct (returns 200 Ok)
6. Delete
- Everything correct (returns 204 No Content)
- Player does not exist (returns 404 Not Found)
- Id from route is not int type (returns 400 Bad Request)
Room
1. Get (by id)
- Everything correct (returns PlayerDto in body and 200 Ok)
- Everything correct, request from player that is not admin (returns RoomDto in body and 200 Ok)
- Room does not exist (returns 404 Not Found)
- Id from route is not int type (returns 400 Bad Request)
2. Get (by join code)
- Everything correct (returns PlayerDto in body and 200 Ok)
- Everything correct, request from player that is not admin (returns RoomDto in body and 200 Ok)
3. Post
- Everything correct (returns location in header and 201 Created)
- Everything correct not required fields are missing (returns location in header and 201 Created)
- JoinCode is occupied (returns 400 Bad Request)
- JoinCode wrong format (returns 400 Bad Request)
- MaxPlayers is not type int (returns 400 Bad Request)
- MaxPlayers is greater than 100000 (returns 400 Bad Request)
- MaxPlayers is empty (returns 400 Bad Request)
4. Put
- Everything correct (returns 200 Ok)
- Everything correct given only specific fields (returns 200 Ok)
- JoinCode is occupied (returns 400 Bad Request)
- JoinCode wrong format (returns 400 Bad Request)
- MaxPlayers is not type int (returns 400 Bad Request)
- MaxPlayers is greater than 100000 (returns 400 Bad Request)
- AdminPlayerId does not exist (returns 404 Not Found)
- Player is not admin of target room (returns 403 Forbidden)
5. Delete
- Everything correct (returns 204 No Content)
- Room does not exist (returns 404 Not Found)
- Id from route is not int type (returns 400 Bad Request)
- Player is not admin of target room (returns 403 Forbidden)
Team
1. Get
- Everything correct (returns TeamDto in body and 200 Ok)
- Everything correct, request from player that is not a admin or officer (returns TeamDto in body and 200 Ok)
- Player is not in the same room as target team (returns 403 Forbidden)
- Team does not exist (returns 404 Not Found)
- Id from route is not int type (returns 400 Bad Request)
2. Post
- Everything correct (returns location in header and 201 Created)
- Player is in different room than given RoomId (returns 403 Forbidden)
- RoomId is not int type (returns 400 Bad Request)
- RoomId not found (returns 404 Not Found)
- Name too long (returns 400 Bad Request)
- Name is empty (returns 400 Bad Request)
3. Put
- Everything correct (returns 200 Ok)
!- Everything correct, not required fields missing (returns 200 Ok)
- Name is empty (returns 400 Bad Request)
- Name is too long (returns 400 Bad Request)
- OfficerPlayerId does not exist (returns 400 Bad Request)
- OfficerPlayerId is not type int (returns 400 Bad Request)
- Player is not in the same room as target team id (returns 403 Forbidden)
- Player is neither officer of target team nor admin of target team's room (returns 403 Forbidden)
4. Delete
- Everything correct (returns 204 No Content)
- Room does not exist (returns 404 Not Found)
- Id from route is not int type (returns 400 Bad Request)
- Player is neither officer of target team nor admin of target team's room (returns 403 Forbidden)
Battle
1. Get
- Everything correct (returns BattleDto in body and 200 Ok)
- Player is not in the same room as target battle (returns 403 Forbidden)
- Battle does not exist (returns 404 Not Found)
- Id from route is not int type (returns 400 Bad Request)
2. Post
- Everything correct (returns location in header and 201 Created)
- RoomId is empty (returns 400 Bad Request)
- RoomId is not int type (returns 400 Bad Request)
- Room with id RoomId does not exist (returns 404 Not Found)
- Name is empty (returns 400 Bad Request)
- Name is too long (returns 400 Bad Request)
- Player is in room with different RoomId (returns 403 Forbidden)
3. Put
- Everything correct (returns 200 Ok)
!- Everything correct, not required fields missing (returns 200 Ok)
- Name is empty (returns 400 Bad Request)
- Name is too long (returns 400 Bad Request)
- Player is in room with different RoomId (returns 403 Forbidden)
- Player is neither officer of target team nor admin of target Battle's Room (returns 403 Forbidden)
4. Delete
- Everything correct (returns 204 No Content)
- Battle does not exist (returns 404 Not Found)
- Id from route is not int type (returns 400 Bad Request)
- Player is not admin of target Battle's Room (returns 403 Forbidden)
- Player is neither officer of target team nor admin of target Battle's Room (returns 403 Forbidden)
Location
1. Get
- Everything correct (returns LocationDto in body and 200 Ok)
- Player is not in the same room as target Location's Player (403 Forbidden)
- Location does not exist (returns 404 Not Found)
- Id from route is not int type (returns 400 Bad Request)
2. Get (All Player Locations)
- Everything correct (returns LocationDtos in body and 200 Ok)
- Player is not in the same room as target Player (403 Forbidden)
- Player does not exist (returns 404 Not Found)
- Id from route is not int type (returns 400 Bad Request)
3. Post
- Everything correct (returns location in header and 201 Created)
- Longitude is not int type (returns 400 Bad Request)
- Longitude is not between -180 and 180 (returns 400 Bad Request)
- Longitude is empty (returns 400 Bad Request)
- Latitude is not int type (returns 400 Bad Request)
- Latitude is not between -90 and 90 (returns 400 Bad Request)
- Latitude is empty (returns 400 Bad Request)
- Accuracy is not int type (returns 400 Bad Request)
- Accuracy is less than 0 (returns 400 Bad Request)
- Accuracy is empty (returns 400 Bad Request)
- Bearing is not int type (returns 400 Bad Request)
- Bearing is not between 0 and 360 (returns 400 Bad Request)
- Bearing is empty (returns 400 Bad Request)
- Time is not correct datetime format (returns 400 Bad Request)
- Time is empty (returns 400 Bad Request)
4. Put
- Everything correct (returns 200 Ok)
- Player does not exist (404 Not Found)
- Id from route is not int type (returns 400 Bad Request)
- Location does not exist (returns 404 Not Found)
- Player is not owner of target Location (returns 403 Forbidden)
- Longitude is not int type (returns 400 Bad Request)
- Longitude is not between -180 and 180 (returns 400 Bad Request)
- Longitude is empty (returns 400 Bad Request)
- Latitude is not int type (returns 400 Bad Request)
- Latitude is not between -90 and 90 (returns 400 Bad Request)
- Latitude is empty (returns 400 Bad Request)
- Accuracy is not int type (returns 400 Bad Request)
- Accuracy is less than 0 (returns 400 Bad Request)
- Accuracy is empty (returns 400 Bad Request)
- Bearing is not int type (returns 400 Bad Request)
- Bearing is not between 0 and 360 (returns 400 Bad Request)
- Bearing is empty (returns 400 Bad Request)
- Time is not correct datetime format (returns 400 Bad Request)
- Time is empty (returns 400 Bad Request)
5. Delete
- Everything correct (returns 204 No Content)
- Location does not exist (returns 404 Not Found)
- Id from route is not int type (returns 400 Bad Request)
- Player is not owner of target Location (returns 403 Forbidden)
Kill
1. Get
- Everything correct (returns KillDto in body and 200 Ok)
- Player is not in the same room as target Kill's Player (403 Forbidden)
- Id from route is not int type (returns 400 Bad Request)
- Kill does not exist (returns 404 Not Found)
2. Get (All Player Locations)
- Everything correct (returns KillDtos in body and 200 Ok)
- Player is not in the same room as target Player (403 Forbidden)
- Id from route is not int type (returns 400 Bad Request)
- Player does not exist (returns 404 Not Found)
3. Post
- Everything correct (returns location in header and 201 Created)
- Player does not exist (404 Not Found)
- Id from route is not int type (returns 400 Bad Request)
- Longitude is not int type (returns 400 Bad Request)
- Longitude is not between -180 and 180 (returns 400 Bad Request)
- Longitude is empty (returns 400 Bad Request)
- Latitude is not int type (returns 400 Bad Request)
- Latitude is not between -90 and 90 (returns 400 Bad Request)
- Latitude is empty (returns 400 Bad Request)
- Accuracy is not int type (returns 400 Bad Request)
- Accuracy is less than 0 (returns 400 Bad Request)
- Accuracy is empty (returns 400 Bad Request)
- Bearing is not int type (returns 400 Bad Request)
- Bearing is not between 0 and 360 (returns 400 Bad Request)
- Bearing is empty (returns 400 Bad Request)
- Time is not correct datetime format (returns 400 Bad Request)
- Time is empty (returns 400 Bad Request)
4. Put
- Everything correct (returns 200 Ok)
- Location does not exist (returns 404 Not Found)
- Player is not owner of target Location (returns 403 Forbidden)
- Longitude is not int type (returns 400 Bad Request)
- Longitude is not between -180 and 180 (returns 400 Bad Request)
- Longitude is empty (returns 400 Bad Request)
- Latitude is not int type (returns 400 Bad Request)
- Latitude is not between -90 and 90 (returns 400 Bad Request)
- Latitude is empty (returns 400 Bad Request)
- Accuracy is not int type (returns 400 Bad Request)
- Accuracy is less than 0 (returns 400 Bad Request)
- Accuracy is empty (returns 400 Bad Request)
- Bearing is not int type (returns 400 Bad Request)
- Bearing is not between 0 and 360 (returns 400 Bad Request)
- Bearing is empty (returns 400 Bad Request)
- Time is not correct datetime format (returns 400 Bad Request)
- Time is empty (returns 400 Bad Request)
5. Delete
- Everything correct (returns 204 No Content)
- Kill does not exist (returns 404 Not Found)
- Id from route is not int type (returns 400 Bad Request)
- Player is not owner of target Kill (returns 403 Forbidden)
Death
1. Get
- Everything correct (returns DeathDto in body and 200 Ok)
- Player is not in the same room as target Death's Player (403 Forbidden)
- Id from route is not int type (returns 400 Bad Request)
- Death does not exist (returns 404 Not Found)
2. Get (All Player Locations)
- Everything correct (returns DeathDtos in body and 200 Ok)
- Player is not in the same room as target Player (403 Forbidden)
- Id from route is not int type (returns 400 Bad Request)
- Player does not exist (returns 404 Not Found)
3. Post
- Everything correct (returns location in header and 201 Created)
- Player does not exist (404 Not Found)
- Id from route is not int type (returns 400 Bad Request)
- Longitude is not int type (returns 400 Bad Request)
- Longitude is not between -180 and 180 (returns 400 Bad Request)
- Longitude is empty (returns 400 Bad Request)
- Latitude is not int type (returns 400 Bad Request)
- Latitude is not between -90 and 90 (returns 400 Bad Request)
- Latitude is empty (returns 400 Bad Request)
- Accuracy is not int type (returns 400 Bad Request)
- Accuracy is less than 0 (returns 400 Bad Request)
- Accuracy is empty (returns 400 Bad Request)
- Bearing is not int type (returns 400 Bad Request)
- Bearing is not between 0 and 360 (returns 400 Bad Request)
- Bearing is empty (returns 400 Bad Request)
- Time is not correct datetime format (returns 400 Bad Request)
- Time is empty (returns 400 Bad Request)
4. Put
- Everything correct (returns 200 Ok)
- Location does not exist (returns 404 Not Found)
- Player is not owner of target Location (returns 403 Forbidden)
- Longitude is not int type (returns 400 Bad Request)
- Longitude is not between -180 and 180 (returns 400 Bad Request)
- Longitude is empty (returns 400 Bad Request)
- Latitude is not int type (returns 400 Bad Request)
- Latitude is not between -90 and 90 (returns 400 Bad Request)
- Latitude is empty (returns 400 Bad Request)
- Accuracy is not int type (returns 400 Bad Request)
- Accuracy is less than 0 (returns 400 Bad Request)
- Accuracy is empty (returns 400 Bad Request)
- Bearing is not int type (returns 400 Bad Request)
- Bearing is not between 0 and 360 (returns 400 Bad Request)
- Bearing is empty (returns 400 Bad Request)
- Time is not correct datetime format (returns 400 Bad Request)
- Time is empty (returns 400 Bad Request)
5. Delete
- Everything correct (returns 204 No Content)
- Death does not exist (returns 404 Not Found)
- Id from route is not int type (returns 400 Bad Request)
- Player is not owner of target Death (returns 403 Forbidden)