Unit testing assemblies with internals

How do you unit test an assembly if the vast majority of its methods are declared “internal” (in C#)? Before today, I had no idea. Fortunately for me, one of my consultants had this exact problem last year. The solution:

[assembly: InternalsVisibleTo(“UnitTestAssemblyName”)]

Putting the following line in AssemblyInfo.cs for the assembly you wish to unit test makes everything declared “internal” available to UnitTestAssemblyName.

This is a vastly superior option to cloning the assembly you want to test and making all the internal members public.

A rant on programmers who can’t program

I came across this post today and wasn’t sure what to make of it.  In my current job and my previous one, interviewing potential hires for programming was part of my job.  I can’t say I ever used “FizzBuzz” types of questions on candidates, and I’m not sure that would tell me the sort of things I need to know about someone.  I find myself asking a lot more design questions and process questions with perhaps one or two programming questions thrown in.  But before even getting to that stage, I have to feel good about their resume.  I think the majority of people give you enough information in their resume that you can figure out whether a phone screen is worthwhile in a relatively short period of time.

Working with virtual machines

A few weeks ago, my employer updated the RAM on a bunch of our machines to 2GB. The reasons was so we could do our development using virtual machines.  I haven’t done development work this way before (probably because I never worked anywhere before that gave you enough RAM).

So far, it’s only been a bit different than working with everything directly installed.  Visual Studio 2005 is a bit slower (of course).  The other minor inconvenience is that I can’t add new users to TFS from my virtual machine.  I suspect this has more to do with it being configured incorrectly than with the virtual machine not being part of the domain.  Access to network shares is virtually unchanged, since you can map network drives and connect using a different user name.

What Makes a Good Software Developer?

TSS.NET posed this question in one of their newsgroups on March 1.  Here are the comments I added to the thread:

They only write what they need to. They tend to choose open source libraries and components for needed functionality instead of writing things themselves. They definitely don’t replicate functionality already provided by whatever platform they’re coding against (whether it’s .NET or Java).
A companion characteristic is that they’re good integrators. Because they use third-party components to develop solutions, they’re skilled at making them play well with each other.
They’re good at refactoring. The first version of any application is always the worst one. A good software developer refines and otherwise improves their code as they go along.
The companion characteristic to refactoring is unit testing. No developer can consider themselves good unless this practice is part of their everyday work. A robust set of unit tests is the first line of defense when it comes to high-quality code.

This was what I came up with off the top of my head.  I’d be curious to hear opinions from others (yes, all three of my loyal readers) on what makes a good software developer.


I came across a couple of useful posts from Scott Guthrie about App_Offline.htm. This page appears and disappears automatically when the “Publish Web Site” option is used. What I didn’t know is that it’s part of the .NET framework (not the IDE). This means the page can be added and removed manually. This will be especially useful in my current environment, where we depend on network engineers to deploy web applications to test and production sites.

Here are the posts:
App_Offline.htm and IE Friendly Errors

Announcing App_Offline.htm

The Honest Boss

Some friends of mine on a mailing list I belong to are having an interesting dialogue on ways to deal with co-workers when they make mistakes.  One of the list members posted a link to the interview with an honest boss e-card from Hallmark.  Mostly, it’s good for a laugh.  But what the “honest boss” says about promotions is a bit too true to be funny.