You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We should add tests for our generated models to make changes way more safer and see immediately if we break something.
We should look into adding the tests to the Example/ folder and we could swift test for that project.
I ran into the issue in #67 as I wanted to be sure that the model dictionary is the same as calling dictionaryRepresentation on it. The tests could look like something like that:
varimageModelDictionary:[AnyHashable:Any]=["height":(12),"width":(11),"url":"http://google.com"]varimage=Image(modelDictionary: imageModelDictionary)XCTAssert(imageModelDictionary.isEqual(to: image.dictionaryRepresentation),"Image dictionary representation should be the same as the model dictionary.")varuserModelDictionary:[AnyHashable:Any]=["id":(123),"first_name":"Michael","last_name":"Schneider","image": imageModelDictionary]varuser=User(modelDictionary: userModelDictionary)XCTAssert(userModelDictionary.isEqual(to: user.dictionaryRepresentation),"User dictionary representation should be the same as the model dictionary")
The text was updated successfully, but these errors were encountered:
We should add tests for our generated models to make changes way more safer and see immediately if we break something.
We should look into adding the tests to the
Example/
folder and we couldswift test
for that project.I ran into the issue in #67 as I wanted to be sure that the model dictionary is the same as calling
dictionaryRepresentation
on it. The tests could look like something like that:The text was updated successfully, but these errors were encountered: