What is a more convenient way of doing this:
EXPECT_EQ(mock->params.size(), 2);
EXPECT_EQ(mock->params[0], "firstCall");
EXPECT_EQ(mock->params[1], "secondCall");
One problem with the above is that the test cases will crash when doing test driven development where the size of mock->params will first be zero before the actual code under test is written.
BTW, I am not allowed to use GoogleMock since it needs certain compiler flags which I can’t use. I can use std and boost.
You may try to use Boost.Assign. For instance, list_of sequence can be compared with vector:
live demo
Output is: