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 there, I've inherited an mvc application that uses lightspeed 5. I am trying to add unit testing to the project, but have been having difficulty doing so. The current setup is like this:
I have read the documentation on Unit Testing in lightspeed, but I'm not sure how to adapt it to this project as I seem to keep running into a wall of generated code. Any help in how to Mock the UnitOfWork object or some other method of unit testing would be much appreciated! Regards, Marc. |
|
|
Hi Marc, You can mock against IUnitOfWork but this is still a fairly large interface. Another option is to defined your own interface which more tightly scopes what the UnitOfWork exposes within the scope of your application (e.g. just the IQueryable properties) and implement your typed UnitOfWork against that interface (which it already will implement) and then your mock object should be a bit more succinct.
|
|