we've been looking into using the new Fakes framework to help us increase the test coverage on some legacy code running under the .net 4.0 framework. Unfortunately, it seems like we're going to be unable to upgrade to .net 4.5. Would I be correct in saying that we cannot use the Fakes framework with .net 4.0 (and VS2012) and that we'd need to use the now unsupported Moles framework instead?
Although I'm not a fan of moles in general, I understand the help they can be in getting tests around legacy code. Below are some other tools you can consider. But seriously, I hate these types of frameworks because the right way to do things is to write code that is testable and refactor legacy code that isn't (I understand that this isn't always easy or possible). I think moles gets rid of the one of the major benefits of unit testing, which is that it forces you to write good code as discussed here:
Here are a couple of things to consider:
There is also a free, light version of JustMock, not sure what it includes.
You should use Visual Studio 2012 Ultimate or Premium Update 2 to be able to use Microsoft Fakes, and unit tests can target earlier versions of .NET framework.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With