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
|
Hey, I've been looking through the code for the backgroundmotion sample and i see in there that there is an InMemoryRepository. When I'm testing functionality within a domain object (eg validation) I don't really want to go all the way through to the database - in this case I'd usually look to mock the repository with an inmemory one but I can't find in the latest LS assembly an IRepository (or even a RepositoryBase) that i could use for this. Can you point me to the best way to run unit tests against LS derived objects without having to hit the db? thanks |
|
|
Hi Justin, To take the database out of the equation you can mock IUnitOfWorkFactory and IUnitOfWork and set your IUnitOfWorkFactory on LightSpeedContext. Also, some types of entity testing such as validation can be performed by just newing up the entity in question and testing against that. Cheers, Andrew. |
|