Part 3
2 chapters
Mocking
GoogleMock from first principles: mocks, matchers, actions, and designing code that can be mocked.
Chapter 9
GoogleMock fundamentals
Replace a real collaborator with a mock so you can test a unit in isolation: declare a mock with MOCK_METHOD, set expectations with EXPECT_CALL, match arguments, assert how many times a call happens, and stub background interactions with ON_CALL.
Chapter 10
Advanced mocking and testability
Go beyond the first mock: design code with seams you can inject, control a mock's strictness with NiceMock and StrictMock, assert call ordering with InSequence, capture arguments with SaveArg, and know when a fake beats a mock.