Hi,
I need help figuring out how I can change the method call inside of another
method.
For example:
public class A
{
public string getValue()
{
string retVal = "";
B b = new B();
retVal = b.getB();
retVal = retVal + " Final ";
return retVal;
}
}
public class B
{
public string getB()
{
return "B";
}
}
public class BStub
{
public string getBStub()
{
return "BStub";
}
}
public class TestDriver
{
public static void Main()
{
A aClass = MockRepository.GenerateMock<A>();
B bClass = MockRepository.GenerateStub<B>();
bClass.Stub(x=>x.getB()).Return(new BStub().getBStub())
.Do(new Func<string>(()=>new
BStub().getBStub()));
string result = aClass.getValue(); //I am not getting any value to
result
//In this case, I
want to get "BStub Final" after calling
// getValue()
method on 'aClass'
}
}
Any help would be appreciated.
Thanks
--
You received this message because you are subscribed to the Google Groups
"Rhino.Mocks" group.
To view this discussion on the web visit
https://groups.google.com/d/msg/rhinomocks/-/lvq3GMbEl9cJ.
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.