mardi 16 avril 2019

Is it good to write tests with indirect data rather than exact, raw data? [on hold]

I am writing tests for a function which parses data from json to create an object, but for asserts I used indirect not raw data.

I already wrote few of those and it seems fine for me. Json file will not change and so the data.

Normal test with raw data:

assert(json["name"], object.name)

My tests with indirect data:

assert("John", object.name)

Aucun commentaire:

Enregistrer un commentaire