Hi!
I have an issue that is equal to what described in the post titled
"GetEvent call on mocked interface".
Premise: I'm using Rhinomocks 2.9.6 because I need to work on .NET
1.1.
I'm testing a class - which we can call MySubscriber - which collects
the list of events implemented by a class and add a delegate to a
specified event. The event name is specified as a string so the class
has to retrieve the event by means of reflection.
I've seen that, when passing a mock object to MySubscriber,
MySubscriber is not able to retrieve the list of its events.
Infact, let's suppose that I have an interface which declares an
event:
public interface IMyInterface
{
event MyEventHandler MyEvent;
}
If I do the following in my test method...
...
mock_object = mocks.CreateMock( typeof(IMyInterface) ) as
IMyInterface;
mocks.ReplayAll();
Assert.That( mock_object.GetType().GetEvents().Length,
Is.EqualTo( 1 ));
...
... I get a failure on the Assert. That's because it seems that the
events are not part of the mocked interface.
I've done the same with Rhinomocks 3.6.0 and .NET 3.5 I DON'T get the
failure.
QUESTIONS:
1. Could you confirm that this was a bug of RhinoMocks 2.9.6 fixed
with following versions or am I making some wrong assumption?
2. In the mean time, I had to workaround the problem by manually
creating a new class implementing IMyClass only for testing purposes.
Any other suggestion?
Thank you very much!
Bye!
Ivan
--
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.