chevron-thin-right chevron-thin-left brand cancel-circle search youtube-icon google-plus-icon linkedin-icon facebook-icon twitter-icon toolbox download check linkedin phone twitter-old google-plus facebook profile-male chat calendar profile-male
Welcome to Typemock Community! Here you can ask and receive answers from other community members. If you liked or disliked an answer or thread: react with an up- or downvote.
0 votes
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
asked by rzhu (2.8k points)

1 Answer

0 votes
Hi Richard,

Let's take this offline - I will contact you through our support email and we'll meet to find out what happened. Once this is fixed I'll post the resolution here.

Doron
Typemock Support
answered by doron (17.2k points)
...