I have this code in my unit test:
var file = m_Mockery.NewMock<IFile>();
Stream s = new MemoryStream();
Expect.Once.On( file ).Method( "OpenRead" )
.With( "someFile.mdb")
.Will( Return.Value( s ) );
...
...
...
// this runs the real code that contains the OpenRead call
productionCodeObj.DoIt("someFile.mdb");
m_Mockery.VerifyAllExpectationsHaveBeenMet();
The problem is when I call DoIt (which calls OpenRead), I get an exception saying the file cannot be found. Am I misunderstanding what nmock does? I don't want my unit test to hit the real filesystem...