I think this is what a MultiMock is for. So you would create your mock
as a MultiMock specifying both interfaces it needs to implement.

2009/10/22 samscore <[email protected]>:
>
> Hello,
>
> does anybody know how I can query an interface on a mock? Is this
> possible?
>
> I have this code to be tested:
> _______________________________________
>            set
>            {
>                logger.Info("Entering property 'FcOutput'");
>
>                isFeatureClassValid(value, typeof(U), inputNeedsZ,
> inputNeedsM);
>
>  !--->         if(().RowCount(null) != 0)
>                {
>                    string message = "parameter 'FcOutput' must be an
> empty feature class.";
>                    logger.Warn(message);
>                }
>
>                fcOutput = value;
>            }
> _________________________________________
>
> value is a mock of the interface IFeatureClass, but in the marked line
> it is queried to ITable.
> So my test fails because an NullReferenceException because (value as
> ITable) returns null.
>
> Does anybody have an idea? I need a mock with two interface, which can
> be casted from
> IFeatureClass to ITable? Surley, I can alter the original source code,
> but thats not a solution for me...
>
> Thanks
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to