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, We are using TestUnitOfWork.SetCollectionResult as part of our Unit Tests. The issue I am facing is that I am not sure how to set consequitive calls. For example if I am unit testing a function that has two consequitive calls UnitOfWork.Find and I want to mock both results how wouuld I set up my unit test.
Thanks Very much
Susan |
|
|
Hi Susan, At present you cannot resolve this with the current impelementation of the TestUnitOfWork.SetCollectionResult. You may be able to use a richer mocking framework to incercept that when a certain query is run you expect a certain resultset (and populate that with a resultset using the EntityFactory methods). I'll have a think about how this could be extended to better support your scenario, but aside from giving a collection or results, or finding a way of binding a certain query to a result set I'm not entirely sure what an elegant API for your scenario would be. John-Daniel |
|