API, . Typemock Isolator ++. , extract_content_type, ( , ), :
TEST_METHOD(TestExtractContentType)
{
Http_server* server = new Http_server();
std::string res ("result");
PRIVATE_WHEN_CALLED(server, extract_content_type, NULL).Return(&res);
std::string result;
ISOLATOR_INVOKE_MEMBER(result, server, extract_content_type, NULL);
PRIVATE_ASSERT_WAS_CALLED(server, extract_content_type);
Assert::AreEqual(string("result"), result);
}
. ISOLATOR_TESTABLE , .
ISOLATOR_TESTABLE std::string extract_content_type(const std::string& request) const
. , .