Little progress on my forked version of AsUnit

I managed to add a new preReq method and to amend the cleanUp method to be executed at the beginning of a TestCase and at the end, so before and after all the tests run.
I added them because I think, in some test cases, you want to prepare the field for the tests and then clean it up. For example you want to create some mock objects that are going to be used in more that one test and you don’t want to create/destroy them in each setUp/tearDown.

So the new TestCase sequence is

  • preReq
  • setUp
  • testMethod
  • tearDown
  • setUp
  • testMethod
  • tearDown
  • ….
  • cleanUp

I also added the ability to handle async operations in all the states of the TestCase   preReq/setUp/tearDown/cleanUp. In the previous version the tearDown and cleanUp didn’t handle async operations.

There was also a little gotcha in the original version of AsUnit, it didn’t consider the fact that some event callbacks can be too fast and it wasn’t picking them up correctly. To fix that I added new flags to double check if a state has finished processing async operations and so avoid calling the next state twice.

you can find the git repo here:

http://github.com/vizio360/asunit

UPDATE

I’m thinking to use RobertPenner ASUnit4 – FreeRunner and so abandonig my forked version of AsUnit3 , there’s no point in reinventing the wheel.

you can find his repo here:

http://github.com/robertpenner/asunit/tree/freerunner

This entry was posted in AsUnit, TDD. Bookmark the permalink. Post a comment or leave a trackback: Trackback URL.
blog comments powered by Disqus