I have a list of objects and a list of expected values that the objects can evaluate to after running them through a function.
std::vector<Objects> actual;
std::vector<Enum> expected;
bool equals(Object one, Enum two);
I want to be able to do something like UnorderedElementsAre with a matcher or use Pointwise without expecting an order.
I have a couple thoughts for solutions, but I'm looking for other suggestions (especially one's more native to gtest or that make the test easier to read)
- Sort
actualthen usePointwise - Convert all values in
actualto the correspondingEnumvalue then doUnorderedElementsAreon that list andexpected - Write a matcher that hides 1 or 2
Aucun commentaire:
Enregistrer un commentaire