Monday, June 01, 2009

Getting started with IronPython - Part 3: unit testing

This is the third part of Dror Helper's series on getting started with IronPython. Part 1 was on first steps, including useful references. Part 2 focused on the Python programming language, introducing an example game project that Dror is using to learn IronPython. As promised part 3 is on testing the game with the Python unittest module.
Being a TDD’er (Test Driven Developer) one of the first things I’ve searched for when I started learning IronPython is a unit testing framework, luckily for me I didn’t need to search too long.

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

No comments:

Post a Comment

Note: only a member of this blog may post a comment.