FAQ’s

What is FUnit?

FUnit is the first generation of xUnit based unit-testing tool to leverage the custom metadata capabilities of the Flex mxmlc compiler. FUnit is comparable to patterns observed in NUnit, and carries with it a widely adopted framework API with tightly integrated strong-typed metadata and other reflection related capabilities.

The tag-based attribute model of FUnit makes it the most intuitive unit-testing framework ever created for the Flex platform.

Is it Free?

Yes. Like it’s predecessors, FUnit will be both free and open source.

When will it be available?

Although development of FUnit is still in it’s alpha stages, a ConsoleRunner with debug output for Adobe FlexBuilder and a number of other advanced features are already publicly available. The FUnit Framework Roadmap has also been published and provides a detailed overview of feature delivery stages preceding the final 1.0 Release.

Due to limited and often unpredictable time constraints, feature release dates cannot be determined at this time. If you have questions or concerns regarding the project delivery schedule, please feel free to contact me directly.

How does FUnit compare with FlexUnit?

FlexUnit Implementation

public class TestExecute extends TestCase
{
   public static function getSuite() : TestSuite
   {
      var suite : TestSuite = new TestSuite();
      suite.addTest(new TestExecute("testGetString"));
      suite.addTest(new TestExecute("testExecuteNull"));
 
      return suite;
   }
 
   public override function setup() : void
   {
      CustomClass.setString("TestString");
   }
 
   public function testGetString() : void
   {
      // sample code to test
      Assert.assertEquals( CustomClass.getString(), "TestString");
   }
 
   public function testExecuteNull() : void
   {
      try
      {
         // sample code to test
         CustomClass.execute( null );
      }
      catch ( e:ArgumentError )
      {
         // exception thrown correctly
         return;
      }
      catch ( e:Error )
      {
         // exception thrown but of wrong type
         throw new AssertionFailedError("Invalid exception.");
      }
 
      // no exception was thrown
      throw new AssertionFailedError("Uncaught exception");
   }
}

FUnit Implementation

[TestFixture]
public class TestExecute
{
   public static function getSuite() : TestSuite
   {
      var suite : TestSuite = new TestSuite();
      suite.add(TestExecute);
 
      return suite;
   }
 
   [SetUp]
   public function setup() : void
   {
      CustomClass.setString("TestString");
   }
 
   [Test]
   public function getString() : void
   {
      // sample code to test
      Assert.areEqual( CustomClass.getString(), "TestString");
   }
 
   [Test]
   [ExpectedError("ArgumentError")]
   public function executeNull() : void
   {
      // sample code to test
      CustomClass.execute( null );
   }
}

Key Differences:

  • No need to extend the TestCase base class
  • Tests are marked with the [Test] metadata tag
  • No “test” prefix is required for TestCase methods to be reflected
  • Expected failures are easily marked with an [ExpectedError] tag
  • Supports SetUp, TearDown, FixtureSetUp, and FixtureTearDown
  • SetUp is marked with the [SetUp] tag – No override needed
  • Advanced Collection and String assertion support
  • and much more…
Bookmark and Share

.