-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
#15 Feature/15 create gungi game #25
Conversation
… which causing interface change
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
General Comments
- add an e2e test for validating user input (ie. body should contain a list of players and it should be 2, otherwise return 400)
- think of other places where you need to be more defensive of inputs and where things will break
At the minimum it needs to defend against these cases:
- 1 - no body
curl --location --request POST 'localhost:8000/gungi/create' \
--header 'Content-Type: application/json' \
--data-raw '{}'
- 2 - wrong body
curl --location --request POST 'localhost:8000/gungi/create' \
--header 'Content-Type: application/json' \
--data-raw '{
"somethingElse": []
}'
- 3 - wrong player data
curl --location --request POST 'localhost:8000/gungi/create' \
--header 'Content-Type: application/json' \
--data-raw '{
"players": [
{ "unkonwnField": "asdf" },
{ "id": "asdf", "noName": "noNom" }
]
}'
- 4 - less than expected player number
curl --location --request POST 'localhost:8000/gungi/create' \
--header 'Content-Type: application/json' \
--data-raw '{
"players": [
{ "id": "id1", "name": "nameOne" }
]
}'
- 5 - more than expected player number
curl --location --request POST 'localhost:8000/gungi/create' \
--header 'Content-Type: application/json' \
--data-raw '{
"players": [
{ "id": "id1", "name": "nameOne" },
{ "id": "id2", "name": "nameOne" },
{ "id": "id3", "name": "nameOne" }
]
}'
2bc1ec7
to
b4072cc
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
look good to me
#15
Description
send request to initialilze gungi game
How to test
New Dependencies