Mocking attributes - C#
- by bob
I use custom Attributes in a project and I would like to integrate them in my unit-tests.
Now I use Rhino Mocks to create my mocks but I don't see a way to add my attributes (and there parameters) to them.
Did I miss something, or is it not possible? Other mocking framework? Or do I have to create dummy implementations with my attributes?
example: I have an interface in a plugin-architecture (IPlugin) and there is an attribute to add meta info to a property. Then I look for properties with this attribute in the plugin implementation for extra processing (storing its value, mark as gui read-only...)
Now when I create a mock can I add easily an attribute to a property or the object instance itself?
EDIT: I found a post with the same question - link. The answer there is not 100% and it is Java...
EDIT 2: It can be done... searched some more (on SO) and found 2 related questions (+ answers)
here and here
Now, is this already implemented in one or another mocking framework?