Dev Craftsmanship SIG: Mocking - Making fun of unit tests using DI

Do you avoid writing unit tests because of your database? Are your unit tests hundreds of lines long, with a ton of setup and teardown code? Have you heard of Dependency Injection and want to see examples of it in action? Do you wonder what the D is in the SOLID principles? Are people around you always talking about "mocks", and you want to see what all the hubbub is about? Have you inherited a project that has no unit tests, and you are struggling with how to add them after-the-fact? Would you like to see a logical follow-up to the Nov 30th presentation on Unit Testing? 

If you said 'Yes' to any of these questions, this presentation is for you. In this presentation, we will discuss two key topics: Dependency Injection and Mocking. I will show a piece of code that is already 'complete', without any DI or mocking. We will then walk through refactoring that code, step-by-step, until it is fully unit-tested, using newly-written mocks. If you have never written a mock, I invite you to come see how they are created, and, more importantly, why they are useful. This presentation is entirely in PowerPoint, so all you need to bring is yourself. Come see why mocking is another great tool to have in your software development toolbelt!

Presenter: Derick Linkous

Group Name: Triangle .NET User Group

Wednesday, January 25, 2017 03:00:00 PM