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
Hello, I am testing typemock.

I am trying to do something like:
var fileStream = Isolate.Fake.Instance<FileStream>();

But am getting an exception saying:
"TypeMock.TypeMockException: *** Cannot mock types from mscorlib assembly."

However, there is a list (http://site.typemock.com/mscorlib-types) where you said it is supported (as well as you do with MemoryStream, which throws the same exception..)

I've got the latest version (downloaded yesterday).

Am I doing something wrong?

PS. I cannot create a wrapping class, as suggested in the forum, as the code is currently in production.

Thanks!
asked by panalex (640 points)

2 Answers

0 votes
Panalex,

Unfortunately, this is a documentation error, and the said page reflects a yet unreleased (and unstable) version of Isolator. We intend to add this support in the future.

In the meanwhile, can you share a bit more information about what you are trying to test, so we may suggest a workaround?

Doron
Typemock Support
answered by doron (17.2k points)
0 votes
Hi Doron,

Thanks for your reply, I saw in older posts the documentation was wrong but though it was for previous versions of typemock.

Just wanted to know whether I was doing something wrong or there was another way to mock callings to some mscorelib classes we are using in our code.

I was just playing/testing the framework and comparing it to Microsoft Moles, the other option we are considering, since conventional mock frameworks require important code modification.

Thanks.
answered by panalex (640 points)
...