Unfortunately the following pattern does not work in RhinoMocks:
[SetUp]
public void SetUp ()
{
obj.Stub(s => s.Prop).Returns("a suitable default for all tests");
}
[Test]
public void VerySpecificTest ()
{
obj.Stub(s => s.Prop).Returns("specific value, valid only for this single test");
}
It does not even throw an exception (which is particularly bad), the user just does not know why the second Stub()
call does not have any effect whatsoever.
However, is there a way to make this work? How to "overwrite" a single property return?