Unit Testing: Using Extension Methods for better Exception Catching
January 30, 2012
Improving unit testing, and use some sleek OOP too. Let’s say that we want to test a call to a basic stored procedure, where @ClientID is required. EXEC MYDB.MYSCHEMA.GetClients @ClientID = 10001 Now we want to test the database call in a unit test. If we don’t pass in @ClientID, we should expect a SqlException, … More Unit Testing: Using Extension Methods for better Exception Catching