Skip to content

Commit 10f5722

Browse files
authored
generated test cases (#35)
for comment and consideration
1 parent e890802 commit 10f5722

File tree

5 files changed

+161
-0
lines changed

5 files changed

+161
-0
lines changed

__tests__/create.testcases.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# /create Endpoint Test Cases
2+
3+
## Expected Behaviors
4+
5+
### 1. POST /create with valid object
6+
- Should return 201
7+
- Response: created object
8+
9+
### 2. POST /create with missing required fields
10+
- Should return 400
11+
- Response: error message indicating missing fields
12+
13+
### 3. POST /create with malformed JSON
14+
- Should return 400 or 500
15+
- Response: error message, no stack trace
16+
17+
### 4. POST /create with empty body
18+
- Should return 400
19+
- Response: error message
20+
21+
### 5. POST /create with duplicate object
22+
- Should return 409
23+
- Response: error message indicating conflict
24+
25+
---
26+
27+
Add new cases as needed. Checklist for /create route.

__tests__/delete.testcases.md

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# /delete Endpoint Test Cases
2+
3+
## Expected Behaviors
4+
5+
### 1. DELETE /delete with valid object ID (body)
6+
- Should return 204
7+
- Response: no content
8+
9+
### 2. DELETE /delete/:id with valid object ID (param)
10+
- Should return 204
11+
- Response: no content
12+
13+
### 3. DELETE /delete with missing object ID
14+
- Should return 400
15+
- Response: error message indicating missing ID
16+
17+
### 4. DELETE /delete with malformed JSON
18+
- Should return 400 or 500
19+
- Response: error message, no stack trace
20+
21+
### 5. DELETE /delete with empty body
22+
- Should return 400
23+
- Response: error message
24+
25+
### 6. DELETE /delete/:id with non-existent object
26+
- Should return 404
27+
- Response: error message indicating not found
28+
29+
---
30+
31+
Add new cases as needed. Checklist for /delete route.

__tests__/overwrite.testcases.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# /overwrite Endpoint Test Cases
2+
3+
## Expected Behaviors
4+
5+
### 1. PUT /overwrite with valid object and version
6+
- Should return 200
7+
- Response: overwritten object
8+
9+
### 2. PUT /overwrite with missing version
10+
- Should return 400
11+
- Response: error message indicating missing version
12+
13+
### 3. PUT /overwrite with version mismatch
14+
- Should return 409
15+
- Response: error message indicating conflict
16+
17+
### 4. PUT /overwrite with malformed JSON
18+
- Should return 400 or 500
19+
- Response: error message, no stack trace
20+
21+
### 5. PUT /overwrite with empty body
22+
- Should return 400
23+
- Response: error message
24+
25+
---
26+
27+
Add new cases as needed. Checklist for /overwrite route.

__tests__/query.testcases.md

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
# Query Route Test Cases
2+
3+
This file documents the test cases for the /query endpoint. These are not executable tests, but serve as a checklist for future test harness development.
4+
5+
## Expected Behaviors
6+
7+
### 1. POST /query with body {}
8+
- Should return 200
9+
- Response: empty result set (e.g., [])
10+
11+
### 2. POST /query with body []
12+
- Should return 400
13+
- Response: error message indicating invalid query shape
14+
15+
### 3. POST /query with body null
16+
- Should return 400
17+
- Response: error message indicating invalid query
18+
19+
### 4. POST /query with body ""
20+
- Should return 400
21+
- Response: error message indicating invalid query
22+
23+
### 5. POST /query with body 0
24+
- Should return 400
25+
- Response: error message indicating invalid query
26+
27+
### 6. POST /query with body true
28+
- Should return 400
29+
- Response: error message indicating invalid query
30+
31+
### 7. POST /query with valid query object
32+
- Should return 200
33+
- Response: result set matching query
34+
35+
### 8. POST /query with malformed JSON (e.g., {broken json)
36+
- Should return 400 or 500
37+
- Response: error message, no stack trace
38+
39+
### 9. POST /query with missing limit/skip
40+
- Should default to limit=10, skip=0
41+
- Should return 200
42+
43+
### 10. POST /query with negative limit/skip
44+
- Should return 400
45+
- Response: error message indicating invalid parameters
46+
47+
---
48+
49+
Add new cases as needed. This file is for planning and tracking test coverage for /query route.

__tests__/update.testcases.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# /update Endpoint Test Cases
2+
3+
## Expected Behaviors
4+
5+
### 1. PUT /update with valid object
6+
- Should return 200
7+
- Response: updated object
8+
9+
### 2. PUT /update with missing object ID
10+
- Should return 400
11+
- Response: error message indicating missing ID
12+
13+
### 3. PUT /update with malformed JSON
14+
- Should return 400 or 500
15+
- Response: error message, no stack trace
16+
17+
### 4. PUT /update with empty body
18+
- Should return 400
19+
- Response: error message
20+
21+
### 5. PUT /update with non-existent object
22+
- Should return 404
23+
- Response: error message indicating not found
24+
25+
---
26+
27+
Add new cases as needed. Checklist for /update route.

0 commit comments

Comments
 (0)