Stanislav Vodetskyi
02/26/2024, 9:44 PM// provider state: given obj exists
{
"objs": {
"pact:match": "eachValue(matching($'obj')),atLeast(1)",
"obj": {
"field": "matching(type, 'sample')"
}
}
}
which is cool and exactly what I want to express.
However, if, theoretically speaking, my client code had branching like if len(objs) == 1 {} else {}
we would want our client code to hit both branches. Would we want a separate consumer test for that? What should we specify? I guess we could do provider state define multiple objects, but what would I put in the matcher then?rholshausen
02/26/2024, 10:29 PMStanislav Vodetskyi
02/26/2024, 10:55 PMrholshausen
02/26/2024, 10:56 PMrholshausen
02/26/2024, 10:58 PMStanislav Vodetskyi
02/26/2024, 11:01 PMatLeast
constraint is the best option, if you also have unit tests validating the client code for edge conditions, is that correct?rholshausen
02/26/2024, 11:02 PMStanislav Vodetskyi
02/26/2024, 11:02 PM