4 Replies Latest reply on Jan 17, 2010 4:27 PM by Lampei



      Does this actually work?  I tried using the example in the turnkey project, but each time I try to reference a testcase in one of my test classes I get initializationError, No tests found matching function Function() {} from [object ClassRequest]


      I've set it up like this:

      core.run( Request.method( DateAddTest, "testYear" ) );


      where DateAddTest is my test class and testYear is the name of the function within DateAddTest.


      Am I doing something wrong?

        • 1. Re: Request.method

          Yes, it works.


          The two places you could have an issue, is testYear public?


          Does testYear have [Test] metadata defined above it?



          • 2. Re: Request.method
            Lampei Level 1



            public function testYear():void {
                var _dateEqualMatcher:DateEqualMatcher = new DateEqualMatcher( new Date( 2015, 0, 1 ) );
               Assert.assertTrue( _dateEqualMatcher.matchesSafely( DateUtils.dateAdd( DateUtils.YEAR, 6, new Date( 2009, 0, 1 ) ) ) );



            Very weird.  I've been having some issues with my FlexUnit4 and unit testing, which I guess is running over into this.  For some reason, it isn't failing my unit tests ( Assert.assertTrue( -1, 1) is coming back as true ???), so I guess this is related to that.  I'll check into that and see what the hecks happening with my code.



            • 3. Re: Request.method
              mlabriola Level 4

              Let me know what you find, however, that is the way Flash Builder integrates with our code base, so I know that works.


              Incidentally, assertEquals( -1, 1 ) should fail.


              However, your post said assertTrue( -1, 1 ), which is a bit different.



              • 4. Re: Request.method
                Lampei Level 1

                Crap.  I guess I was using the wrong thing all along   I switched that out and it failed...correctly


                Thanks for the help.  I'll still look into the Request.method not working, but at least the assertEquals problem is solved.