public interface IService
{
string Do();
}
public class RhinoTest
{
[Test]
public void Test()
{
var service = MockRepository.GenerateStub();
// in real some complex setup of bunch of mocks in separate method
service.Stub(x => x.Do()).Return("first setup");
// than I missed that service is already set up
service.Stub(x => x.Do()).Return("second setup");
var str = service.Do();
Assert.That(str == "second setup"); // fails
}
}
Is it possible at least give a warning (or even fail a test with warning) that method Do is set up twice?