|
From: Nick R. <nic...@fr...> - 2004-07-28 19:20:51
|
Hi,
I am mocking an interface, and inside the client class I need to do a query
for a different type:
Client(ISomeInterface someInterface)
{
INewInterface interface = someInterface as IAnotherInterface;
if(interface != null)
{
...
}
}
someInterface is a mock. The only way I know how to work with this is to
stub the interface rather than mock it - I cannot move away from the
downcast. Is it possible to do this on a mock? I get the feeling I would
need to do something like:
DynamicMock someInterfaceMock = new DynamicMock(typeof(ISomeInterface));
someInterfaceMock.Supports(typeof(IAnotherInterface));
Or something like that....
nick.robinson
site : www.fromconcept.co.uk
blog : www.fromconcept.co.uk/weblog.aspx
draco : www.sourceforge.net/projects/draconet
|