Philip Hendry's Blog
Sporadic musings from Philip Hendry

Testing Internals

Aug 26, 2009 • Code, Testing • Less than a minute read

There’s a very handy attribute called InternalsVisibleTo that can be used in a class to make internally declared members accessible to a specific assembly. This probably isn’t wise for most situations but it’s very handy for testing internals from a separate test assembly. It’s also handy to provide a parameterised constructor that can accept different dependencies whilst the default constructor is hard-wired to the standard dependencies – this seems like an easy way to add DI for the purposes of testing to existing applications without disturbing the app structure too much or introducing a confusing DI factory.  Read →

Strongly Typing Enumeration Parsing

Aug 25, 2009 • Code • Less than a minute read

Given this enum :  Read →

Encapsulating methods of persistence

Aug 21, 2009 • ASP.NET, Code, Design • 1 min read

Here’s a question. What’s wrong with this code :  Read →