Is it possible with Rhino Mocks to create a stub, that throws exception for all calls?
public interface IMyIF
{
// Some methods
}
[TestClass]
public class MyTestClass
{
[TestMethod()]
public void MyTest()
{
MockRepository mocks = new MockRepository();
IMyIF stb = mocks.Stub<IMyIF>();
// Somehow set stb to throw some exception on every method call
// without knowing all the methods and overloads in IMyIF interface
// use stb to test something
}
}
var stb = MockRepository.GenerateStrictMock<IMyIF>();