Re: [flexcoders] FlexUnit asserError()?

2007-05-31 Thread Douglas McCarroll
Just posted on my blog about this:

http://www.brightworks.com/flex_ability/?p=39

Thanks again, Angus.


Douglas McCarroll wrote:

 Thanks, Angus!

 Angus Johnson wrote:
 
  Douglas,
 
  One way to test for failure:
 
  try
  {
  ... // code that should throw exception
  fail('Exception was not thrown');
  }
  catch
  {
  // test exception type / message etc is what is expected
  }
 
  hth
  Angus
 
  On 31/05/07, *Douglas McCarroll*
  [EMAIL PROTECTED] 
 mailto:org.yahoo_primary.001%40douglasmccarroll.com
  mailto:[EMAIL PROTECTED] 
 mailto:org.yahoo_primary.001%40douglasmccarroll.com wrote:
 
  Hi All,
 
  I'd like to write FlexUnit tests that confirm that certain things
  cause
  my code to throw errors.
 
  assertError(), so to speak.
 
  I don't see any way to do this. Is there a way?
 
  Thanks in advance!
 
  Douglas
 
  -
 
  Douglas McCarroll
  Flex Developer
  http://www.brightworks.com http://www.brightworks.com 
 http://www.brightworks.com http://www.brightworks.com
  617.459.3840
 
  -
 
 
 

  



[flexcoders] FlexUnit asserError()?

2007-05-30 Thread Douglas McCarroll
Hi All,

I'd like to write FlexUnit tests that confirm that certain things cause 
my code to throw errors.

assertError(), so to speak.

I don't see any way to do this. Is there a way?

Thanks in advance!


Douglas


-

Douglas McCarroll
Flex Developer
http://www.brightworks.com
617.459.3840

-



Re: [flexcoders] FlexUnit asserError()?

2007-05-30 Thread Angus Johnson

Douglas,

One way to test for failure:

try
{
  ... // code that should throw exception
  fail('Exception was not thrown');
}
catch
{
  // test exception type / message etc is what is expected
}

hth
Angus
On 31/05/07, Douglas McCarroll [EMAIL PROTECTED]
wrote:


  Hi All,

I'd like to write FlexUnit tests that confirm that certain things cause
my code to throw errors.

assertError(), so to speak.

I don't see any way to do this. Is there a way?

Thanks in advance!

Douglas

-

Douglas McCarroll
Flex Developer
http://www.brightworks.com
617.459.3840

-

 



Re: [flexcoders] FlexUnit asserError()?

2007-05-30 Thread Douglas McCarroll
Thanks, Angus!


Angus Johnson wrote:

 Douglas,

 One way to test for failure:

 try
 {
... // code that should throw exception
fail('Exception was not thrown');
 }
 catch
 {
// test exception type / message etc is what is expected
 }

 hth
 Angus

 On 31/05/07, *Douglas McCarroll* 
 [EMAIL PROTECTED] 
 mailto:[EMAIL PROTECTED] wrote:

 Hi All,

 I'd like to write FlexUnit tests that confirm that certain things
 cause
 my code to throw errors.

 assertError(), so to speak.

 I don't see any way to do this. Is there a way?

 Thanks in advance!

 Douglas

 -

 Douglas McCarroll
 Flex Developer
 http://www.brightworks.com http://www.brightworks.com
 617.459.3840

 -