Test Your .NET 3.5 Apps: C#: Check for Correct Input: Listing 1

The sample relies on a method that accepts only string values from the UI layer and performs validation within the class. Among other things, this approach allows you to write unit tests to examine all possible combinations for passing bad data to this method.