Joe White’s Blog

Life, .NET, and Cats


dSpec for readable DUnit assertions

dSpec, from Jody Dawkins of delphixtreme.com, has the same goal as DUnitAssertions: readable tests. Here are some examples from her post titled “dSpec Update“:

Specify.That(Foo).Should.Equal(3);
Specify.That(Bar).Should.Be.OfType(TBlueWidget);
Specify.That(Baz).Should.Be.GreaterThan(50).And.Be.LessThan(60);

Thanks, Jody, for letting me know about dSpec. It looks pretty cool.

dSpec and DUnitAssertions take somewhat different approaches. dSpec uses what I would think of as more of a RhinoMocks-style syntax, whereas DUnitAssertions is more NUnitLite-like. But dSpec has one huge advantage over DUnitAssertions: it’s released. (I’m still waiting for paperwork from Legal. Plus I’m not done yet.)

I’ll probably keep working on DUnitAssertions, since I think there might be benefits to both approaches; perhaps someday we’ll see something that combines the best of both. But I may well start using dSpec. If you’re looking to write readable DUnit assertions today, dSpec is your ticket.

Thanks, Jody!

2 Responses to “dSpec for readable DUnit assertions”

  1. Maruis Marais Says:

    You should also look at NSpecify that has the same syntax than dSpec. http://nspecify.sourceforge.net/ or http://sourceforge.net/projects/nspecify

    Cheers…

  2. Joe White's Blog Says:

    Readable behavior-driven tests for DUnit: DUnitLite

Leave a Reply

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>


Joe White's Blog copyright © 2004-2008. Portions of the site layout use Yahoo! YUI Reset, Fonts, and Grids.
Proudly powered by WordPress. Entries (RSS) and Comments (RSS).