Using nDepend to understand, and improve legacy code

One of the issues when dealing with legacy code is missing information. Unlike newly developed code which has up to date documentation or at least some developers who know design decisions and implementation details. Legacy code is a completely different story - the original developers usually are not around to answer any questions, documentation is … Continue reading Using nDepend to understand, and improve legacy code

New Pluralsight course: Advanced C++ Mocking Using Google Mock

My latest course: Advanced C++ Mocking Using Google Mock was published during the weekend. After finishing my very first Pluralsight course I knew I want to author another one. I've been working with C++, Java and .NET developers for the last five years, teaching about clean code, design patterns and unit testing. I've seen good developers struggle with TDD, … Continue reading New Pluralsight course: Advanced C++ Mocking Using Google Mock

Using conditional breakpoints to filter exceptions during debugging

With every new version the C# language has grown and improved. The last version so a.k.a C# 6 has brought some of my favorite features. And with C# 7 just around the corner I know there's more to come. One of the new useful features added to C# is the ability to filter exceptions. Consider … Continue reading Using conditional breakpoints to filter exceptions during debugging

Faking DateTime using Microsoft Fakes seems to be broken

It seems as if causing DateTime.Now to return another value has become the demo to show when demoing an unconstrained Mocking framework. It’s easy to show and needed in many unit tests – unless you want your tests to be affected by time – trust me and you don’t. That’s why I was amazed to … Continue reading Faking DateTime using Microsoft Fakes seems to be broken

The real difference between NUnit and XUnit

I’ve just started yet another pet project and wanted to pick a unit testing framework (.NET). On a soon-to-regret whim I’m tried googling “NUnit vs. XUnit” and read the first 10 posts I got. They were informative and mostly correct, unfortunately all completely missed the one big difference between those two excellent unit testing frameworks… … Continue reading The real difference between NUnit and XUnit

Comparing Two objects using Assert.AreEqual()

Anyone who ever googled (binged?) about unit testing have heard about the “one assert per test rule”. The idea is that every unit test should have only one reason to fail. It’s a good rule that help me write good, robust unit test – but like all such rules-of-the-thumb it’s not always right (just most … Continue reading Comparing Two objects using Assert.AreEqual()