handler_test.h (753B)
1 #include "mock_event_handler.h" 2 #include "yaml-cpp/yaml.h" // IWYU pragma: keep 3 4 #include "gmock/gmock.h" 5 #include "gtest/gtest.h" 6 7 using ::testing::InSequence; 8 using ::testing::NiceMock; 9 using ::testing::StrictMock; 10 11 namespace YAML { 12 class HandlerTest : public ::testing::Test { 13 protected: 14 void Parse(const std::string& example) { 15 std::stringstream stream(example); 16 Parser parser(stream); 17 while (parser.HandleNextDocument(handler)) { 18 } 19 } 20 21 void IgnoreParse(const std::string& example) { 22 std::stringstream stream(example); 23 Parser parser(stream); 24 while (parser.HandleNextDocument(nice_handler)) { 25 } 26 } 27 28 InSequence sequence; 29 StrictMock<MockEventHandler> handler; 30 NiceMock<MockEventHandler> nice_handler; 31 }; 32 }