Blog Archives

How does my mock know what value I want?

It is early afternoon. You just started your job at Glamorous Inc. Your buddy this morning talked about unit tests. How they want all code to have unit tests but also have code that was written before they started doing that. And they want you to start by getting some of that code under test.

Read more ›




How do I make a method use a different class in unit tests?

The code you work on has this wonderful simple method. All it does is use a couple of other classes, passing through the parameters it received and setting some properties.

As it is such a simple function nobody bothered to write any tests for it. After all, “It only passes through to another class.”

Read more ›




Show Buttons
Hide Buttons