This thread looks to be a little on the old side and therefore may no longer be relevant. Please see if there is a newer thread on the subject and ensure you're using the most recent build of any software if your question regards a particular product.
This thread has been locked and is no longer accepting new posts, if you have a question regarding this topic please email us at support@mindscape.co.nz
|
Hi Guys. I have a need to write unitTest for services that use UnitOfWork. To do this I need to substitute of data returned UnitOfWork. everything works fine, BUT if I need to return a non-empty set of data, and a concrete set of specific ID is a problem, because I can not create object DAL.User with a given ID (or set the ID after creation)
|
|
|
See the Mindscape.LightSpeed.Testing namespace and in particular the EntityFactory class. Help Topics > Unit Testing in the help file also has some useful tips and info. |
|
|
Thanks. I found how create DAL.User with a given ID. |
|
|
I've added a designer option which will be included in nightly builds dated 31 July 2010 and above. Select the model (click on the background), go to the properties window, find the Code Generation Options setting, and set VirtualQueryProperties to checked. Then save your model, check the generated code, and the LINQ UOW properties should now be virtual. Let us know if you run into any problems. |
|
|
i install build 01 Aug. But i don't see the specified option. http://screencast.com/t/YzEwYjFmYT |
|
|
Mea culpa. You will need to open the .lsmodel file in a text editor and add the following attribute to the <model> element: codeGenerationOptions="VirtualQueryProperties" Sorry for the confusion. |
|
|
thank you very much for quick response. It's working well |
|