Let's assume I have a DTO with optional parameters...
# general
y
Let's assume I have a DTO with optional parameters, for example:
Copy code
{
  a: int //mandatory
  b: int //optional
}
What is the best practice, to create 1 test that cover all the DTO or 2 tests, one for all the parameters, and the second with the mandatory only? I am afraid from overhead, in case I have multiple optional, should I cover all the permutation??!! Thanks in advance
m
I would do two. One with all mandatory only and one with all (If you can). More generally though, cover the scenarios your consumer expects
y
thanks for your comment, it will not make a lot of tests? or in other words, it verify all the contracts, and this is the aim of pact
m
The aim is to cover the representative examples your consumers need. You want to be careful not to bother into functional tests though
🙏 1