Blog Archives

How to verify a method actually gets called – without a mocking framework


Hard labor

You have busted your bum writing a solid MagnificentValidation validation method that checks the input data for a whole slew of data manipulation methods. And you, of course, covered it with unit tests so nobody, not even you, can accidentally mess up the validation logic without it being noticed.

Read more ›

Act like a pessimist and call CanHandle from Handle (again)?

You have multiple Worker classes that can each handle a one or more types of command. Your IWorker interface offers two methods: CanHandle and Handle.


Anyone with work to be done can now find a worker that says “yay, I can handle this” and then pass off the work to that worker.

Read more ›

Show Buttons
Hide Buttons