Hi, I'm going to try Active Record in my next project, and I'd like to get some advice on testable design. Specifically, I'd like to avoid talking to the database as much as possible.
For example, suppose I've got a ProductRepository class, and I want to test the GetProductsByCategory method. The most straightforward way would be to create a Category, a Product, save them to the database, then just run the query. But that's a lot of extra work: you have to ensure all the mandatory fields, you have to cleanup etc. Doesn't sound like a unit test. I don't know much about NHibernate, but I gathered that there's some sort of in-memory cache. What if I could just put my Product into that cache, not saving it, and run the subsequent query against this cache? Is it possible? On the other hand, I have seen that there's some in-memory database in Rhino Commons, but the wiki link is broken, and I couldn't find it in the source. Anybody uses it? Will it help me with that problem? Thanks a lot for your help ulu --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Castle Project Users" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/castle-project-users?hl=en -~----------~----~----~----~------~----~------~--~---
