我是GTest / Gmock的新手。 以下是课程:
class HttpRequest
{
public:
std::string name;
std::vector<std::string> headers;
HttpRequest()
{
name = "HTTP"
headers.push_back( "ZERO" );
headers.push_back( "ONE" );
headers.push_back( "TWO" );
}
virtual ~HttpRequest();
}
当尝试使用下面的EXPECT_CALL函数来使用GTest / Gmock验证此对象的成员时,我收到错误error C2228: left of '.at' must have class/struct/union
EXPECT_CALL ( requestHandler, Send(
AllOf(Field(&HttpRequest::name, "HTTP"),
Field(&HttpRequest::headers.at(0), "ZERO")
)
)).Times(1);
任何输入/建议都会非常有用,谢谢。