• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
Locked
0

Testing a service that returns an AsyncToken

Enthusiast ,
Jan 05, 2011 Jan 05, 2011

Copy link to clipboard

Copied

I have a working test that tests a service that returns an AsyncToken. I am using AsyncResponder instead of any of the Aysnc Flexunit stuff. Is this OK?

One thing I don't get is that the passthroughData get passed to the onResult method, even though AsyncResponder doesn't pass on anything other than the event.

    [Test(async)]

        public function testAttemptLogin():void

        {

      var token: AsyncToken = objectToTest.attemptLogin('k');

     token.addResponder(new AsyncResponder(onResult, faultHandler));

        }

        private function onResult(event:ResultEvent,passthroughData:Object):void {

//assertions

            }

TOPICS
FlexUnit

Views

2.9K

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Advocate ,
Jan 05, 2011 Jan 05, 2011

Copy link to clipboard

Copied

No. This will not work.

FlexUnit has a Async.asyncResponder

method that will do what you want

Mike

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Enthusiast ,
Jan 05, 2011 Jan 05, 2011

Copy link to clipboard

Copied

LATEST

works for me, and brings the data back

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines