Log in

View Full Version : Steps to test a JSON



charlesprabhu
08-23-2021, 04:30 AM
Create a JSON test file.
Grab some JSON from your API and save it to a file in your project.
Create a test case.
Create a new XCTestCase subclass, then write a test method.
Load the JSON data into the test case.
Call your parser with the JSON data.
Make assertions on the result.

Melissahill045
08-25-2021, 01:52 AM
1. Create a JSON test file. Grab some JSON from your API and save it to a file in your project. ...
2. Create a test case. Create a new XCTestCase subclass, then write a test method. ...
3. Load the JSON data into the test case. ...
4. Call your parser with the JSON data. ...
5. Make assertions on the result.