Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Wiki Markup
A TestCase is a collection of [TestMethods|FlexUnit Test MethodTestMethod] that share a common test environment. When using FlexUnit4, each *TestCase* has a {{[\[Before\]|FlexUnit Before]}} and {{[\[After\]|FlexUnit After]}} metadata tags that can be used to decorate methods you want to run before and/or after each test method.  These metadatas simulate the {{setUp()}} and {{tearDown()}} methods of fluint and FlexUnit .9. So, for example, if you wanted to write a series of [[TestMethods|FlexUnit Test MethodTestMethod]] to test the Flex Timer class, they could all exist in a single TestCase. In the method decorated with {{\[Before\]}} you would create a Timer instance to test use in your tests. In the method decorated with {{\[After\]}}, you would stop that timer and remove references so it can be garbage collected.  
Additionally, you may decorate any number of static methods per class with the medatadata {{[\[BeforeClass\]|FlexUnit BeforeClass]}} and {{[\[AfterClass\]|FlexUnit AfterClass]}}.  These methods will be run once per test class.

...