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
using TypeMock;


void someFunction(){
MockManager.Init();
cart = new MockManager.Mock(typeof(Cart));
}

Why is the above code not even compiling, I am getting the following error when I try to compile it.

'MockManager.Mock(System.Type)' denotes a 'method' where a 'class' was expected

Am I missing something?
asked by rxraza (1.8k points)

1 Answer

0 votes
cart = new MockManager.Mock(typeof(Cart));


Hi,
Just remove the new statment :D (MockManager.Mock is a mock factory)
You can also see the example files that are distributed with the installation.
answered by scott (32k points)
...