alkampfer on May 5th, 2011

Testing for equality Floating point numbers is usually a bad idea, this because rounding occurs with floating point operations and you need to test with a tolerance. Suppose you test that some algorithm produces the expected result and you find that unit test fails with this message. SharpTestsEx.AssertException : 2.36 Should Be Equal To 2.36. [...]

kick it on DotNetKicks.com

Continue reading about Unit testing floating point numbers

alkampfer on March 22nd, 2011

Actually SharpTestEx is my favorite way to make assertions in Unit testing. It has a lot of advantages, first of all it permits to write really clear assertions, then it works on the main Unit testing framework, so I can use the same assertion syntax for nunit and for MStest or MbUnit etc etc. Another [...]

kick it on DotNetKicks.com

Continue reading about Writing a custom assertion for SharpTestEx

alkampfer on December 29th, 2010

I’ve build during years a test helper infrastructure that permits me to decorate a test fixture with some custom attributes that are capable to execute code before and after fixture setup/teardown or test setup/teardown. Now my dear friend Ugo needs for Dexter a modified version of this framework to be able to apply attributes directly [...]

kick it on DotNetKicks.com

Continue reading about Test helper for a single method

alkampfer on November 30th, 2010

I use AutoMockingContainer extensively in my test projects, and I ‘ve build over time an automocking container that satisfy all of my needs. Thanks to Castle Windsor, using complex logic with the AutomockingContainer is a breeze. Suppose you have this ViewModel Figure 1: ViewModel under test The only aspect I’m interested in is the SelectedLinkResult [...]

kick it on DotNetKicks.com

Continue reading about Castle and Automock, avoid resolving properties

alkampfer on November 22nd, 2010

Some days ago the Feature pack 2 was released. This pack will extend testing capabilities of VS2010, and one of the coolest addition is a graphical editor for the UIMap of Coded UI test. Another killer feature is the official support to run coded ui test With Mozilla firefox 3.5 or higher and support for [...]

kick it on DotNetKicks.com

Continue reading about Feature Pack 2