David Berry


I’m a Solutions Architect with over 20 years of experience in building software systems. I started out as a Java developer and then switched to .NET in 2003. I’ve also done significant work with SQL Server and Oracle. I’m a Pluralsight author and have presented at community events throughout the Midwest. I try to bring a pragmatic approach to everything I do, making sure the software I build is simple, understandable and balances responsibilities between different components of the system. When speaking or teaching, I emphasize real-world scenarios encountered by developers every day and show how to solve them so you can be more effective at what you do.


Unit Testing Things that Are Hard to Test

Writing automated unit tests has become a standard development practice over the last decade. Yet some types of code remain exceedingly difficult to test in an automated fashion. File IO operations, HTTP requests and date/time dependent code all present problems for writing automated tests. These scenarios are often where we most want to write tests though because files may not exist or can contain bad data, APIs can return strange errors and date time bugs are hard to track down.

Fortunately, there are libraries and techniques in the .NET ecosystem we can use in each of these situations that help us write tests for each of these scenarios. This allows us to simulate all of the different conditions that can occur when using these resources in our tests, making sure that our application code handles each scenario correctly and robustly. In this talk, I’ll demonstrate how to do this so that when we are finished, you can confidently create tests where you were not able to before.