Hanselminutes with Scott Hanselman cover image

The Art of Unit Testing with Roy Osherove

Hanselminutes with Scott Hanselman

00:00

How to Test an Integration Test With a Class Called Storage

An example that I usually use is a very simple one where let's say that you have this class called storage. And this class takes an object with properties and given some property that's from the object, the requirement is that the class calls some sort of logger. Logs to the system. Or maybe it's the web service. So our decision is what do we do with that logger? The logger is considered a dependency because it talks to the external system. Okay. So I'm trying to test storage, not the logger. Is that correct? Well, what you're trying to test is the requirement that it calls the logger. Given that a property on the object being sent is true

Play episode from 13:31
Transcript

The AI-powered Podcast Player

Save insights by tapping your headphones, chat with episodes, discover the best highlights - and more!
App store bannerPlay store banner
Get the app