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
0 votes
see the link:
https://www.typemock.com/HowTypeMockHelps.html

I guess there are some misleadings in the last and second last figures. Objects of Typemock should be located in the test cases rather than domain code. Otherwise, you will pollute your domain code. :P
asked by kyue (4.6k points)

5 Answers

0 votes
Good point,
:idea: Actually unlike other frameworks there are actually NO Objects of TypeMock*. The real method is called and if mocked it will just return the mocked value, so the figures are actually correct!

:!: * TypeMock does create objects when mocking interfaces and abstract classes, these are created in a seperate domain.
answered by scott (32k points)
0 votes
Good point,
:idea: Actually unlike other frameworks there are actually NO Objects of TypeMock*. The real method is called and if mocked it will just return the mocked value, so the figures are actually correct!

:!: * TypeMock does create objects when mocking interfaces and abstract classes, these are created in a seperate domain.


What does "The real method is called and if mocked it will just return the mocked value" mean please? :?:

If the real method mocked is in a concrete class, programmers just mock this class in test case... so TypeMock should be only used in test suite,and there is never "using TypeMock" in production code. Is it correct? :P
answered by kyue (4.6k points)
0 votes
This is Voodoo :-)
It is the magic that makes TypeMock.
There is no "using TypeMock" in Production code, but when you mock the class in your test, the class becomes enchanted and will return the mocked value, or fail the test if the arguments don't match.

(We are using Aspect Oriented Techniques that cause the CLR to return the mocked value.)
answered by scott (32k points)
0 votes
This is Voodoo :-)
It is the magic that makes TypeMock.
There is no "using TypeMock" in Production code, but when you mock the class in your test, the class becomes enchanted and will return the mocked value, or fail the test if the arguments don't match.

(We are using Aspect Oriented Techniques that cause the CLR to return the mocked value.)


Thank scott for quick reply.
The words "the class becomes enchanted and will return the mocked value" mean we "only enchant the class in test domain", right? So, this way, we never need to change anything in production code, or say we never use TypeMock in context out of Test Domain. Correct? :roll:

The figures I mentioned, however, 'induce' :lol: me to think you are implying using TypeMock in production code since the TypeMock Icons in three coupled codes. Actually, they are in test rather than production, right? :wink:
answered by kyue (4.6k points)
0 votes
This is correct, the voodoo only happens when testing. There is no need to change anything in the production code.
I understand your point, I will talk to our graphics to try and create a graphic that explains that the change only happens when testing after Mocking with TypeMock. (I am sure that they will want to create a flash movie 8) )
answered by scott (32k points)
...