I am a newbie so these questions may be real basic. I am using the community edition so I cannot use the natural typemocks.
I am trying to mock the class File and another class StreamReader.
MockManager.Init();
Mock fMock = MockManager.Mock( typeof( File ), Constructor.StaticNotMocked );
MockObject srMock = MockManager.MockObject( typeof( StreamReader ), Constructor.Mocked, typeof( string ) );
//Mock srMock = MockManager.Mock( typeof( StreamReader ), Constructor.Mocked );
fMock.ExpectAndReturn( "OpenText", srMock.MockedInstance, typeof( string ) );
I have tried to use both the MockManager.Mock and MockManager.MockObject with StreamReader and I keep getting the error I listed in the subject line when I try to create the srMock object. What am I doing wrong?
Also, when should I use MockManager.Mock and MockManager.MockObject; what is the difference?
Thanks