• Home
  • Raw
  • Download

Lines Matching refs:mock

284     SocketMock mock;  in TEST()  local
286 mock.ExpectSend("foo"); in TEST()
287 EXPECT_TRUE(SendString(&mock, "foo")); in TEST()
289 mock.ExpectSend("abc"); in TEST()
290 mock.ExpectSend("123"); in TEST()
291 EXPECT_TRUE(SendString(&mock, "abc")); in TEST()
292 EXPECT_TRUE(SendString(&mock, "123")); in TEST()
296 SocketMock* mock = new SocketMock; in TEST() local
298 mock->ExpectSendFailure("foo"); in TEST()
299 EXPECT_FALSE(SendString(mock, "foo")); in TEST()
301 EXPECT_NONFATAL_FAILURE(SendString(mock, "foo"), "no message was expected"); in TEST()
303 mock->ExpectSend("foo"); in TEST()
304 EXPECT_NONFATAL_FAILURE(SendString(mock, "bar"), "expected foo, but got bar"); in TEST()
305 EXPECT_TRUE(SendString(mock, "foo")); in TEST()
307 mock->AddReceive("foo"); in TEST()
308 EXPECT_NONFATAL_FAILURE(SendString(mock, "foo"), "called out-of-order"); in TEST()
309 EXPECT_TRUE(ReceiveString(mock, "foo")); in TEST()
311 mock->ExpectSend("foo"); in TEST()
312 EXPECT_NONFATAL_FAILURE(delete mock, "1 event(s) were not handled"); in TEST()
316 SocketMock mock; in TEST() local
318 mock.AddReceive("foo"); in TEST()
319 EXPECT_TRUE(ReceiveString(&mock, "foo")); in TEST()
321 mock.AddReceive("abc"); in TEST()
322 mock.AddReceive("123"); in TEST()
323 EXPECT_TRUE(ReceiveString(&mock, "abc")); in TEST()
324 EXPECT_TRUE(ReceiveString(&mock, "123")); in TEST()
327 mock.AddReceive("foo"); in TEST()
328 mock.AddReceive("bar"); in TEST()
329 mock.AddReceive("123"); in TEST()
330 EXPECT_TRUE(ReceiveString(&mock, "foobar123")); in TEST()
334 SocketMock* mock = new SocketMock; in TEST() local
336 mock->AddReceiveFailure(); in TEST()
337 EXPECT_FALSE(ReceiveString(mock, "foo")); in TEST()
338 EXPECT_FALSE(mock->ReceiveTimedOut()); in TEST()
340 mock->AddReceiveTimeout(); in TEST()
341 EXPECT_FALSE(ReceiveString(mock, "foo")); in TEST()
342 EXPECT_TRUE(mock->ReceiveTimedOut()); in TEST()
344 mock->AddReceive("foo"); in TEST()
345 mock->AddReceiveFailure(); in TEST()
346 EXPECT_FALSE(ReceiveString(mock, "foobar")); in TEST()
348 EXPECT_NONFATAL_FAILURE(ReceiveString(mock, "foo"), "no message was ready"); in TEST()
350 mock->ExpectSend("foo"); in TEST()
351 EXPECT_NONFATAL_FAILURE(ReceiveString(mock, "foo"), "called out-of-order"); in TEST()
352 EXPECT_TRUE(SendString(mock, "foo")); in TEST()
355 mock->AddReceive("foo"); in TEST()
356 EXPECT_NONFATAL_FAILURE(mock->Receive(&c, 1, 0), "not enough bytes (1) for foo"); in TEST()
357 EXPECT_TRUE(ReceiveString(mock, "foo")); in TEST()
359 mock->AddReceive("foo"); in TEST()
360 EXPECT_NONFATAL_FAILURE(delete mock, "1 event(s) were not handled"); in TEST()
364 SocketMock mock; in TEST() local
367 mock.AddAccept(std::unique_ptr<SocketMock>(mock_handler)); in TEST()
368 EXPECT_EQ(mock_handler, mock.Accept().get()); in TEST()
370 mock.AddAccept(nullptr); in TEST()
371 EXPECT_EQ(nullptr, mock.Accept().get()); in TEST()
375 SocketMock* mock = new SocketMock; in TEST() local
377 EXPECT_NONFATAL_FAILURE(mock->Accept(), "no socket was ready"); in TEST()
379 mock->ExpectSend("foo"); in TEST()
380 EXPECT_NONFATAL_FAILURE(mock->Accept(), "called out-of-order"); in TEST()
381 EXPECT_TRUE(SendString(mock, "foo")); in TEST()
383 mock->AddAccept(nullptr); in TEST()
384 EXPECT_NONFATAL_FAILURE(delete mock, "1 event(s) were not handled"); in TEST()