Hi,
I'm having some trouble getting the Throw methods to work for me. The following code doesn't work for me.
MockObject mockReader = MockManager.MockObject<IDataReader>();
mockReader.AlwaysThrow("GetOrdinal", new IndexOutOfRangeException());
And I get the following error message:
Test method ConstructTestIndexOutOfRangeException threw exception TypeMock.TypeMockException, but exception System.IndexOutOfRangeException was expected. Exception message: TypeMock.TypeMockException:
*** No method GetOrdinal in type System.Data.IDataReader
But when I run the code below it work fine for me.
MockObject mockReader = MockManager.MockObject<IDataReader>();
mockReader.ExpectAndReturn("GetOrdinal", 1);
What's the difference? Both are calling the same method. How to I get the AlwaysThrow code to work?
Thanks,
Eric[/quote]