i have a factory class that i initialize using a register method
Register(string key, Type myInterfaceImpl); //in the body i check that
the Type implements IMyInterface
and that has a method to test
IMyInterface GetMyInterface(string key)
internally this class will istantiate the type using
Activator.CreateIstance that needs an empy ctor so i want to do that
IMyInterface obj = rep.CreateMock<IMyInterface>();
Type objType = obj.GetType();
factory.Register("key", objType);
IMyInterface returnedObj = factory.GetIMyInterface("key");
Assert.That(returnedObj, Is.TypeOf(objType));
i know that this is not a very good code but i think that in general
is usefull to have a mock with an empty ctor to test code that uses
reflection
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Rhino.Mocks" 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/RhinoMocks?hl=en
-~----------~----~----~----~------~----~------~--~---