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
Hi.

In the cheatsheet for Natural Mocks are Interface / Natural mocking
is the following syntax used:
Mocking an abstract class or interface
AbstractClass mockedClass = MockObject<AbstractClass>.CreateObject();
using (RecordExpectations recorder = RecorderManager.StartRecording())
{
mockedClass.AbstractMethod();
}


However, I am missing the CreateObject() method.

Using the following code seems fine though:
MilitaryType mt = RecorderManager.CreateMockedObject<MilitaryType>();


Is this erroneous or ?

/Jes
asked by Larovia (3.8k points)

3 Answers

0 votes
Hi Jes,

Indeed it seems to be a mmistake in our cheatsheet. :oops:
Thank you for pointing this out.
(and yes the intended API in that example was RecorderManager.CreateMockedObject )
answered by lior (13.2k points)
0 votes
And the Learn section has errors as well :?
answered by Larovia (3.8k points)
0 votes
Hi
Thanks for pointing it out.
The learn section is quit big. Can you please tell us where?
answered by ohad (35.4k points)
...