Articles → .NET DESIGN PATTERN → Tester-Doer Pattern In .Net
Tester-Doer Pattern In .Net
Purpose
Potential Exception Throwing Code
List<string> values = someClass.GetAllValues();
Console.WriteLine(values.Count);
Tester-Doer Pattern
- Tester → The code tests the condition
- Doer → The code performs a potentially exception-throwing operation
List < string > values = someClass.GetAllValues();
if (values != null) // Tester
{
Console.WriteLine(values.Count); // Doer
}