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 trying to mock the Microsoft.Practices.EnterpriseLibray.Database object but I can't seem to get it work.
Here's the code I'm trying to mock:
DbCommand command = Database.GetStoredProcCommand("StoredProcedureName");

With the following code:
Mock databaseMock = MockManager.MockAll(typeof(Database));
databaseMock.ExpectAndReturn("GetStoredProcCommand", command).Args("StoredProcedureName");

The result is that I'm getting a static constructor, but GetStoredProcCommand is not expected.
asked by (1.2k points)

1 Answer

0 votes
Please send the exact error.
answered by (32k points)
...