I'm having a problem creating mock object, here's the code:
Mock sqlMock = MockManager.Mock(typeof(SqlConnection));
SqlConnection testSql = new SqlConnection(connString);
supposedly this should be very simple. If I put this into a simple project, after the second line is executed, I can see that the
MockedInstance of sqlMock is a valid SqlConnection object. However, if I put this code in our production project it just won't work. After the second line, the
MockedInstance is still null. There is no other code related to TypeMock or testing in the production code, and I'm trying out TypeMock right now. Can anyone suggest some ways to debug this problem?
Thanks in advance.
Richard Zhu