public void StubSimulatingException()
{
MockRepository repository = new MockRepository();
IGetRestuls resultGetter = repository.Stub<IGetRestuls>();
using(repository.Record())
{
resultGetter.GetSomeNumber("A");
LastCall.Throw(new OutOfMemoryException("The system is out of memory!"));
}
resultGetter.GetSomeNumber("A");
}