In our last article, we looked at how the builder pattern increases the readability of our tests while simultaneously decoupling us from the construction details around the objects we’re testing. Sometimes this pattern by itself isn’t sufficient. Occasionally, we need...
TL;DR Writing automated tests for your complex scenarios is important, but it’s easy for the tests to become difficult for other developers (including your 6-month future-self) to read and understand. Using a builder method for the “happy path” that returns an object...
Because legacy system modernization projects tend to be the exception rather than the norm, most people have limited experience with them. It’s not hard to imagine the result—many of the modernization-specific pitfalls are easy to overlook. Not only is the scale of...
You may be guilty of taking strings for granted. They’re baked into the framework as a built-in type, and since almost every codebase uses them, they tend to just fade into the background. Throughout the years, though, I’ve seen people new to C# use strings in several...
There are times in code when you need to return the results of an operation, but aren’t using a transport mechanism like HTTP that gives you a data structure with built-in statuses. In these situations, a lightweight OpResult class can be really helpful. The original...