Unit tests for business objects

Unit tests for business objects

Old forum URL: forums.lhotka.net/forums/t/9169.aspx

ajj3085 posted on Saturday, July 03, 2010

Ok so I'm getting things setup, starting from stratch, to build Csla business applications, targeting Csla 4.

If I am looking at things correctly, it looks like to target silverlight you end up with two business layer assemblies.   One with the full blown BO definition, but with the DP_xyz methods instead an if !SILVERLIGHT directive, and another Silverlight class library with the files from the .Net version linked in.

That seems fine.  I'm setting up my intermediate BO layer though following this pattern, and my unit test project is currently referencing the full .Net layer.  Is there any need to do the same test for the Silverlight side BO, since it's the same?  What if there's an issue only appearing in SL?

Anyone else come across this?



rfcdejong replied on Saturday, July 03, 2010

Sorry for not really answering your question, i've less experience with unit testing business objects.. i did some unit test on logic hidden in classes and unit testing in WCF. Thru i have a research comming where i've to dive into unit testing business objects in both WPF and Silverlight. There is alot to research and i hope u will share some Wink

Anyway i think there isn't any issue testing for Silverlight, you just have to make sure all your factory methods are using the ASync dataportal. Make sure your unit tests are expecting ASync behaviour.

Please take a look at a blog i found about ASync unit testing, seems it is really usefull.

Copyright (c) Marimer LLC