9 Replies Latest reply on Dec 21, 2010 7:27 AM by nikos101

    How can I make sure all the components in my view have been instantiated for testing

    nikos101 Level 2

      I'm testing a view "view"  which has an ADG but the ADG is null.

       

      trying this code:

      view.adg.dataProvider = data;

       

      How can I make sure all the components in my view have been instantiated for testing?

       

          private var view:UserManagement;
              [Before]
              public function setUp():void
              {
                 
                  view = new UserManagement;
                 
              }

       

      [Test]
              public function testSaveData():void
              {
                  var data:ArrayCollection = new ArrayCollection();
                  for (var i:int = 0; i < 1000; i++)
                  {
                      var element:Object = new Object;
                      element.isModifiedClientSide = Math.round(Math.random()*1);
                      data.addItem(element);
                     
                  }
                 view.adg.dataProvider = data;
               
              }