Natural TypeMocks™ |
TypeMock.NET now supports the innovative Natural TypeMocks™ way of defining expectations.
| |
Chained Natural TypeMocks™ |
With Chained Natural TypeMocks™, you can now set expectations to a full sequence of calls
| |
Better Static Constructor Story |
TypeMock.NET now handles mocking static constructors in a much better way. | |
Auto-Deploy for Build Servers |
It is now possible to run TypeMock.NET tests without installing the software | |
64 bit Side by Side |
64 bit and 32 bit TypeMock.NET versions can now work together on the same machine. | |
Many other cool things |
|
The wizards at TypeMock.com have released a brand new version of TypeMock - one of the coolest Mocking frameorks you've never heard of - and it's a shame you hadn't.
(if you're new to this product, look at the bottom of this post for an explanation)
Here are some of the updated features in the new version:
What's TypeMock?
Basically it allows mocking out (replacing) any object, method or member in your code at runtime. even static method calls, singletons and direct calls to objects can be replaced with "fake" ones, in a few lines of code. That helps write test for code that has a lot of dependencies on other code classes (even web services) without having to change the code to test it.
Sounds too goo to be true?
They are doing it using CLR Profilers (an advanced technique that lets you "intercept" any call to any object - even system classes if you want). It's true, but it does have one big shortcoming for me (outlined in red below)
The benefits touted on the website are:
I outlined that line in red to make a point: Part of the beauty of writing unit tests is that it forces you to restructure and refactor your code for testability. In fact, Testability can indicate a good design. Which is qhy I don't use this tool in my classes about Test Driven Development.
However, I do see lots of use for this in places where refactoring is impossible, or you need to write integration tests that are very complicated. It can help QA people as well as developers, and I do think it's a very good tool to have in your tool belt.
You just need to know that it hides the idea of good design from you, and lets you plow through your tests as if all is well. That's both good and bad. As long as you know the difference - you're OK.