3 Replies Latest reply on Jan 13, 2011 6:33 AM by mlabriola

    Question about the Before/After/Test metadata tags

    jefflage Level 1

      i think that i have read all of the appropriate sections on the wiki but i am a little unclear on how/when i need to add extra info to the Before/After/Test metadata tags.


      thus far, i have not done any unit tests that require a component to be added to the display list.  i was reading the section on how to do that and i see that all of the above mentioned tags have extra info:


      [Before( async, ui )], [After( async, ui )] and [Test( async, ui )]


      what do those do and when/why do i need to use them?




      additionally, i am trying to run this simple example derived from what's on the wiki and it always times out.


      package HM.FO.User {

      import mx.controls.Button;

      import mx.events.FlexEvent;


      import org.flexunit.Assert;

      import org.flexunit.async.Async;

      import org.fluint.uiImpersonation.UIImpersonator;


      public class UserWindowPresenterTest {


      //protected var window:UserWindow;

      protected var button:Button;


      [Before( async, ui )] public function setUp():void {


      //this.window = new UserWindow();

      this.button = new Button();

      //Async.proceedOnEvent( this, this.window, FlexEvent.CREATION_COMPLETE, 20000 );

      Async.proceedOnEvent( this, this.button, FlexEvent.CREATION_COMPLETE, 20000 );

      //UIImpersonator.addChild( this.window );

      UIImpersonator.addChild( this.button );



      [Before( async, ui )] public function tearDown():void {


      //UIImpersonator.removeChild( this.window );

      //this.window = null;


      UIImpersonator.removeChild( this.button );

      this.button = null;



      [Test( async, ui )] public function on_user_saved_clears_password_fields():void {


      // this.window.pass_txt.text = "foo";

      // this.window.pass_confirm_text.text = "bar";


      // var presenter:UserWindowPresenter = this.window.presenter as UserWindowPresenter;


      // presenter.on_user_saved( null );


      // Assert.assertNull( this.window.pass_txt.text );

      // Assert.assertNull( this.window.pass_confirm_text.text );


      Assert.assertTrue( true );