Home | History | Annotate | Download | only in base

Lines Matching defs:mock

6 // correctly.  It just instantiates a mock object and runs through a couple of
7 // the basic mock features.
22 // Simple class that we can mock out the behavior for. Everything is virtual
44 // Declare a mock for the class.
54 // more complex behavior into your mock...though if you start needing these, ask
55 // if you're asking your mock to do too much.
68 MockSampleClass mock;
70 EXPECT_CALL(mock, ReturnSomething())
74 EXPECT_EQ(1, mock.ReturnSomething());
75 EXPECT_EQ(2, mock.ReturnSomething());
76 EXPECT_EQ(3, mock.ReturnSomething());
78 EXPECT_CALL(mock, ReturnNothingConstly()).Times(2);
79 mock.ReturnNothingConstly();
80 mock.ReturnNothingConstly();
85 MockSampleClass mock;
87 EXPECT_CALL(mock, OutputParam(_))
91 mock.OutputParam(&arg);
97 MockSampleClass mock;
99 EXPECT_CALL(mock, OutputParam(_))
103 mock.OutputParam(&arg);
108 // Test a mock of the ReturnSecond behavior using an action that provides an
110 // starting to add too much behavior of the mock, which means the mock
112 MockSampleClass mock;
114 EXPECT_CALL(mock, ReturnSecond(_, AnyOf(Eq(4), Eq(5))))
116 EXPECT_EQ(4, mock.ReturnSecond(-1, 4));
117 EXPECT_EQ(5, mock.ReturnSecond(0, 5));
118 EXPECT_EQ(4, mock.ReturnSecond(0xdeadbeef, 4));
119 EXPECT_EQ(4, mock.ReturnSecond(112358, 4));
120 EXPECT_EQ(5, mock.ReturnSecond(1337, 5));
126 MockSampleClass mock;
128 EXPECT_CALL(mock, ReturnSecond(_, AnyOf(Eq(4), Eq(5))))
130 EXPECT_EQ(4, mock.ReturnSecond(-1, 4));
131 EXPECT_EQ(5, mock.ReturnSecond(0, 5));
132 EXPECT_EQ(4, mock.ReturnSecond(0xdeadbeef, 4));
133 EXPECT_EQ(4, mock.ReturnSecond(112358, 4));
134 EXPECT_EQ(5, mock.ReturnSecond(1337, 5));