Hello,
Recently I was looking into interface named Source in java library named okio.
I was tried to violate this interface with some definitions mentioned TDD With Mock Objects:
This is the example which I'm pointing out (C#):
[Test]
public void Send_Diagnostic_String_&_Receive_Status()
{
var mockTelem=mocks.StrictMock();
mockTelem.Stub(m => m.Connect());
mockTelem.Stub(m => m.OnlineStatus).Return(true);
mockTelem.Expect(m => m.Send(DiagnosticMessage));
//
}
Author says, that this is a SMELL that violates the SRP principle, cause some of the methods in the dependency are mocked, where the other one are stubbed.
From my point of view, Source interface is having really simple and good design, but If I align it with article definition, It looks like a SMELL, cause it has methods for mocking and stubbing.
What you guys think about this topic ?