British Inside

An Englishman living in small town America

James Shaw

News

  • Copyright James Shaw 2004-2007

    Creative Commons License

    View James Shaw's profile on LinkedIn

internal, not private

I've meant to say this before, but use internal1 for your private/protected methods if you can; it will make them available to your unit tests if you ever decide to test them (and of course you should!)

1 I think Friend is the correct term for you VB users

UPDATE: I may need to clarify this. Here is how I setup my projects:

Mycode.cs
UnitTests\MycodeTest.cs

Every class has a corresponding test class in the UnitTests folder, named after the class with a Test suffix. So, although it is in the same assembly you'll see that I need to relax private to internal for the unit tests to have access.

Posted: Wednesday, July 06, 2005 10:11 AM by James

Comments

No Comments

New Comments to this post are disabled