Csla, Unit testing and mocking

Csla, Unit testing and mocking

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

ajj3085 posted on Wednesday, June 30, 2010


I'm looking for some direction on how best to mock csla objects, especially between a root and its children.  I'm under the impression that to effectively do this kind of testing, one really needs to take advantage of the ObjectFactory way of doing things. 

Can someone that's been through this give some advice on how to proceed?  I have an existing Csla project where I'd like to more seperate the unit tests (currently the tests are more like integration tests, because the db is required and a test is really checking a root and it's children at the same time).



bniemyjski replied on Wednesday, June 30, 2010



We have some generated C# NUnit test templates that were contributed that could be used as a reference. They need some work... but they are a starting point for anyone looking for unit testing. You can download them here. I'm currently investigating this user submitted sample that uses mocking.

Hope this helps!


-Blake Niemyjski


Copyright (c) Marimer LLC