When writing my unit tests I don’t like to use hard coded fixed values because I either end up using the same values or, because of that, tests may succeed by coincidence. Over time, I have developed an helper class to generate random values for testing. namespace PauloMorgado.VisualStudio.TestTools...
Like I said before , this as been on the back of my mind for a while. A while back I introduced a way to get the MethodInfo of a method in a strongly typed way using LINQ , and that's how I'm going to make Reflective Mocks more Natural . Well, it's as easy as this: public static class MockExtender...
Posted to
Paulo Morgado
(Weblog)
by
Paulo Morgado
on
01-31-2008
Filed under: .NET, SoftDev, C#, Microsoft, MSDN, MVP, Tools, Testing, LINQ, UnitTests, TypeMock
Eli Lopian from TypeMock™ , has an article on CodeProject about the disadvantages of design for testability and how to use TypeMock™ to remove these disadvantages while keep the advantages of unit testing. I have to say that I agree with Eli: design for testability is BAD. It exposes more that it needs...
There is a good set of articles about Unit Test Patterns in the TypeMock™ site: Unit-Test Patterns for .NET - Part I This article looks at patterns in unit testing and describes the main patterns found in tested .NET code. It also describes the problems with each pattern. Unit Test Patterns for .NET...
Posted to
Paulo Morgado
(Weblog)
by
Paulo Morgado
on
12-26-2007
Filed under: .NET, Community, SoftDev, C#, Microsoft, MSDN, MVP, Tools, Testing, UnitTests, TypeMock
TypeMock announced that Version 3.7.0 of Type.NET is now available. A few of the new features included in this release are: You can now mock mscorlib interfaces. Enterprise Edition only Vista support is now complete. You can fire Multiple instances of Event . Professional version only. Integration with...
On a previous post I introduced a library for generating random values for purposes of unit testing. I received a few comments and questions on my blogs [ ^ ][ ^ ][ ^ ][ ^ ]. Simon says that he’d “generally want every instance of the test I run to be repeatable on *every* run” and he’d “inclined to use...