Posts

Showing posts from October, 2017

List of Visual Studio Keyboard Shortcuts

Here's a link to a great list of keyboard shortcuts for Visual Studio: 149 Shortcuts for Visual Studio 2015 (Windows) While there's no need to memorize the list (that's why someone has created a cheat sheet, after all), it certainly doesn't hurt to look over the list from time to time and try to add one more command to your repertoire.

Quick Example of System.IO.Abstractions Use

I just got on a new project and am trying from the get-go to structure all my code so that it's easily testable. Academically, that is a no-brainer. In practice, though, some chunks of code are more difficult to structure so that they're easily testable. Towards that end, I've been pushing System.IO.Abstractions again. And, to get that going I decided it was time to refresh my examples. In the code below, we see how injecting the file system into the repository ultimately allows us to write testable code. If structured correctly, then our repository requires no subsequent refactoring to run in a unit test environment versus a "real" environment even when dealing with something like the file system. Let's take a look at our code. The Console Application The console application is straightforward. We have a private method (at the bottom) that assembles and returns a mock file system. Next, we perform the following steps: We feed that mock file system