Convert TcpEventSink test to use mocks. Add some docstrings.