|
From: Nick R. <nic...@fr...> - 2004-07-26 22:09:32
|
I have a situation, where I want to return a value from a method call of an
interface, but between the outer object and the interface, a creation occurs
which I am not aware of which is passed into the interface:
outer object.Dosomething(some params)
{
SomeObject someObject = new SomeObject(some of the params);
if(_interface.DoSomething(someObject))
{
...
}
}
I want _interface to return false, but I obviously dont have access to the
someObject instance in my test:
Test
{
interfaceMock.ExpectAndReturn("DoSomething", true, ???);
}
I seem to have the option of introducing an interfaced factory or a stub
that replaces the mock. Do people just ignore this by creating one of these
items and moving on, or do you have a different technique to get around this
situation?
Cheers,
nick.robinson
site : www.fromconcept.co.uk
blog : www.fromconcept.co.uk/weblog.aspx
draco : www.sourceforge.net/projects/draconet
|