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
Our test-suite consists of some older tests not using TypeMock and the newer tests using TypeMock. The older tests require that the static constructors of some classes are called and have setup those classes properly.

But what happens if one of these static constructors was mocked in another test before?

-Will such a mocked static constructor be called again?
-I not, how could I force the CLR to call the static constructor again?

Thank you
JJ
asked by Enceradeira (2.3k points)

1 Answer

0 votes
Hi,
Mocked Static constructors will be called automatically if they where mocked before.
The only time they won't is if you access a field of the class.
In that case, just call a method of that class and TypeMock will do everything for you.

This feature was added in one of the last versions.
answered by scott (32k points)
...