tags:

views:

119

answers:

2

Can anyone recommend tools or articles that help me to learn how to TDD IronPython code?

+1  A: 

IronPython has a good unit testing framework inherited from Python called PyUnit.

Writing unit tests using PyUnit is simple:

  1. import unittest class
  2. Create a class that inherits unittest.TestCase (test fixture)
  3. Write test methods using assertions methods

You can read more about it in the following links:

If you use unittest.py consider using nose as well, nose provides an alternate test discovery and running process for unittest. Should make writing and running unit tests easier.

Dror Helper
+2  A: 

The current version of IronPython (v2.0) doesn't seem to agree with nose. This may have been fixed in 2.6, but I haven't re-run my test to figure that out yet. So for now you're only option - unless someone has experimented with one of the other python testing frameworks - pyunit is you're only choice.

You may also want to check out mock, a mocking framework created by Michael Foord which pretty much guarantees that it's going to work just fine with IronPython. If I recall correctly, he even shows some examples in his book, IronPython in Action.

Finally, you should probably check out this link from the cheesecake project for several other tools that you might be interested in.

Darrell Hawley