Open Vanethos opened 5 years ago
ill do this issue, can you please elaborate it a little more.
Hi @pidwid I'll assign the issue to you
You will need to do a series of tests:
StatusModel
object, serialize it and compare it to the json provided in the descriptionStatusService
class can fetch data from the server and return a correct object. To do that, you will need to creat a new instance of dio with an adapter ( see https://github.com/vostpt/mobile-app/blob/develop/test/utils/dioadapter/parishes_endpoint_adapter.dart for how to do this) and then you will need to test:
-- Mock a 200 response with a valid json object, and you need to test it with an expected object (see the first test to get an idea how to do it)
-- Mock a 200 response with an invalid json and check that it throws an error
-- Mock a 400 response and check that it throws an error.If you need any more instructions please do tell
I'll try to have an example for comparison as soon as possible.
Description Unit tests for the endpoint
GET
{{base_url}}/occurrences/statuses
Pre-Requisites
9
Unit-Tests