May 4, 2009 at 5:14 PM
Edited May 4, 2009 at 5:15 PM
I'm using Rhino Mocks; it's as good as any for my purposes.
What is the cleanest way to unit test my exports using dynamic mocks? I assume I still need to use the container in some capacity because the objects I'm testing have private imports that need to be satisfied by a composition container.
My assumption is that I need to:
1. Create a new container
2. Create a batch to include the required component(s) I'm testing
3. Add the export I'm testing
4. Add mocked objects to satisfy the export's import requirements
5. Add the batch to the container and then query for the export and run my tests.
The problem is in part #4 - how do I specify that a dynamic mock is to be exported under one or more contracts for the purpose of satiusfying my component's imports?