问题
I have heard/read a little about both of these frameworks and have decided I want to use of of the two. Which is better? Why?
Thanks in advance! Oshiwoshydopaliscious
回答1:
Well, TypeMock Isolator is a paid product and Moq is FOSS, so that may be your decision point alone. Beyond that, I believe TypeMock provides the ability to mock statics and legacy code that is unmockable through standard polymorphism.
For blow by blow feature comparisons, there are plenty out there:
http://msmvps.com/blogs/bmains/archive/2009/11/03/moq-and-typemock-in-comparison.aspx
But, I'd say your decision amounts to what you're willing to spend. You get more "Mockability" if you pay more. So, if you're trying to retrofit tests on legacy code with lots of static, you might want TypeMock. If you're starting a green field project and have the luxury of writing testable code from the get-go, Moq is great.
来源:https://stackoverflow.com/questions/9280901/typemock-vs-moq