Mocking Done Badly
using(Playback) { sut.PerformAction(parameter); } This is the last part of a common style of mock test. We see the system-under-test (sut) being asked to perform some action, and some parameter is passed to it. We know it's a mock test because of the Playback bit. What is being tested here? Well something about PerformAction is being tested. Not much there. No clear assert written at the bottom of the test to capture our attention. Let me narrate as I work through the actual code before me, and maybe the readers can respond to tell me whether this really is mocking done badly, or I'm "just not used to good mocking." I struggle not to look at the test name, so the code can speak to me more directly. The parameter is not interesting, it is just a string. There is another variable, which is a stub, but it's not used inside playback. There is a 'record' section, set aside with 'using' and not (thankfully) a #region. In the record sectio...