Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 152005
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T09:32:46+00:00 2026-05-11T09:32:46+00:00

It seems that most XUnit testing frameworks provide assertions for the times when you

  • 0

It seems that most XUnit testing frameworks provide assertions for the times when you want to assert that a given operation will thrown an exception (or an Error in AS3 parlance.) Is there some ‘standard’ way of doing this that I am overlooking, which would explain the absence of an assertError() assertion included with FlexUnit?

I know HOW to implement such a thing, and I will probably add it to my FlexUnit (go open source!), but it seems like such a glaring omission that I’m left wondering if I’m just doing it wrong.

Anyone have thoughts on this?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. 2026-05-11T09:32:47+00:00Added an answer on May 11, 2026 at 9:32 am

    Edit 05/02/2010: I’d now recommend using FlexUnit 4. It uses an extensible metdata system, supports expected exceptions, and also supports running in an integration server environment without the use of AIR.

    Edit: You should have a look at fluint, which was built by people who had enough of FlexUnit and it’s limitations. It might have some of these types of assertions built in.

    I totally agree. In fact, FlexUnit is missing several useful methods (assertEvent, assertArrayEquals, etc). I know you said you know how to implement it, but feel free to use mine:

    public static function assertError(message : String, func : Function, errorClass : Class = null, errorMessage : String = null, errorCodes : Array = null) : Error  {     _assertionsMade++;      if (errorClass == null) errorClass = Error;      try     {         func();     }     catch(ex : Error)     {         if (!(ex is errorClass))         {             fail('Expected error of type '' + getQualifiedClassName(errorClass) + '' but was '' + getQualifiedClassName(ex) + ''');         }          if (errorMessage != null && ex.message != errorMessage)         {             fail('Expected error with message '' + errorMessage + '' but was '' + ex.message + ''');         }          if (errorCodes != null && errorCodes.indexOf(ex.errorID) == -1)         {             fail('Expected error with errorID '' + errorCodes.join(' or ') + '' but was '' + ex.errorID + ''');         }          return ex;     }      if (message == null)     {         message = 'Expected error of type '' + getQualifiedClassName(errorClass) + '' but none was thrown'     }      fail(message);      return null; } 
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 151k
  • Answers 151k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer man grep mentions that -m NUM, --max-count=NUM Stop reading a… May 12, 2026 at 9:54 am
  • Editorial Team
    Editorial Team added an answer This should be pretty close. .MainMenu a { color: #FFF;… May 12, 2026 at 9:54 am
  • Editorial Team
    Editorial Team added an answer It means the font size of @2009 should be -2… May 12, 2026 at 9:54 am

Related Questions

There are quite a lot of unittesting frameworks out there for .NET. I found
It seems that most of the installers for Perl are centered around installing Perl
it seems that most of the time, the speed gained is not worth it
In my experience it seems that most people will tell you that it is

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.