Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class TestObject
- {
- public:
- TestObject() : state("A") {}
- void moveToB()
- {
- if (state == "A")
- {
- state = "B";
- }
- }
- void moveToC()
- {
- if (state == "B")
- {
- state = "C";
- }
- }
- std::string state;
- };
- void testAB(TestObject& t)
- {
- t.moveToB();
- ASSERT_EQ("B", t.state);
- }
- void testBC(TestObject& t)
- {
- t.moveToC();
- ASSERT_EQ("C", t.state);
- }
- TEST(MOVE_TO_B)
- {
- TestObject t;
- testAB(t);
- }
- TEST(MOVE_TO_C)
- {
- TestObject t;
- testBC(t);
- }
- TEST(INTEGRATE_A_TO_C)
- {
- TestObject t;
- testAB(t);
- testBC(t);
- }
Add Comment
Please, Sign In to add comment