1 Reply Latest reply on Jul 21, 2010 7:03 AM by mlabriola

    Assertions are not counted


      Hi all,


      I have a question. I've just setup a test with 1 case (for now) and inside this case there are several test functions. All used classes extends from their appropiate classes (i.e. the case class extends from flexunit.framework.TestCase etc).


      The suite is started as follows:




      core:FlexUnitCore = new FlexUnitCore();


      new UIListener(uiListener));


      new CIListener());




      Where the uiListener is:




      <adobe:TestRunnerBase id="uiListener"




      100%" />

      There are currently 4 functions added as tests. Two of them are empty at the moment, the other two have several assertions in them. Now when I run the test all the tests are succesfully completed. But there is one value shown in the Runner that isn't correct. Behind the green / red image that tells if a test was succesfull or not there is a value showing the amount of assertions made during a particular test. All these values show the number 0 (zero).


      This correct for 2 of the test methods, but the other 2 methods have 13 and 35 assertions. This is not shown in the TestRunner. Do I need to set something in the runner or is this a functionality that hasn't been completely implemented yet?


      I'm using flexunit-uilistener-4.0.0.swc






        • 1. Re: Assertions are not counted
          mlabriola Level 4

          Hi Rick:


          The answer is both easy and complicated.


          First, in the 4.0 version there were times when the assertion count did not work correctly. This has been fixed in the 4.1 betas and will be released in the near future as 4.1.


          Second, you are using FlexUnit 4.0, but you are writing FlexUnit .9 style tests. FlexUnit 4.0 can run our newer style tests and it can also run the older .9 version of tests. I know this because you mention extending TestCase, which is only a requirement of the older version. If you are starting new or writing new tests, I would take a look at the newer syntax and capabilities of 4 rather than relying on the older version which is no longer supported.