Get Even More Visitors To Your Blog, Upgrade To A Business Listing >>

Unit testing the CodeSmith CSLA Templates

During the development of our Codesmith Csla Templates we have spent a lot time unit testing the generated code to ensure everything was working correctly.

In the future we would like to generate basic CRUD Unit Tests for any project. We decided to unit test the PetShop database to go along with our PetShop Sample application. We have a solution both in VB and C# that can be found in (Documents\CodeSmith\Samples\v5.2\Projects\Framework-Samples\Csla) when you install CodeSmith or grab the latest version from SVN. We have unit tests for all the Data Access implementations as well as collections. We test primarily against two tables, Category and LineItem.

These NUnit tests will give you a good understanding of how different operations are performed in CSLA. Feel free to submit to CodeSmith support or forums any unit tests you think we don't have.  If you find a bug in the Csla Templates, its a huge help to the community and us if you submit a failing unit test for the PetShop sample application that can reproduce your bug. This ensures we have more testability and no regressions in future versions. However, any unit test will be appreciated along with the respected sample schema.

When contributing new unit tests, please try to follow our common testing pattern for consistency that outputs a description and how long it took to run the test.



This post first appeared on Blogs - Windowscoding.com;, please read the originial post: here

Share the post

Unit testing the CodeSmith CSLA Templates

×

Subscribe to Blogs - Windowscoding.com;

Get updates delivered right to your inbox!

Thank you for your subscription

×