Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migrated to Confluence 4.0

What is a Test?

A Test, "Unit Test," or TestMethod is the basic element of the entire FlexUnit framework. Simply put, it is a method meant to verify the expected behavior of a very narrow use case of a class, a global method, or any bit of isolatable code, providing a simple pass/fail result. In its most basic form, it is made up of two parts:

...

NOTE: It is worth noting that a test is assumed to pass unless it explicitly fails, either by a) not meeting explicitly-specified pass criteria or by b) throwing an error while running the test. In other words, a test is innocent until proven guilty.

What is a Test Case?

A TestCase is a class that contains a) a set of related tests and b) any additional code that should apply across a set of tests. Examples of the latter include, but are not limited to:

  • Global variables that will be used in most or all tests (ex: components you're testing against)
  • Additional FlexUnit 4.x functionality that applies across multiple tests (Note: These include advanced features beyond the purview of this section), like:
    :-Before/After
    :-BeforeClass/AfterClass
    :-Rules
  • Specifying a custom runner to use for the tests

...