Session Information

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 we can use in each of these situations that help us write automated tests. This allows us simulate all of the different conditions that can occur 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.

200 - Intermediate
.NET Testing
14:30
Room 122