MACROMEDIA FLEX 2-TESTING FLEX APPLICATIONS WITH MERCURY QUICKTEST PROFESSIONAL Manuale Utente Pagina 23

  • Scaricare
  • Aggiungi ai miei manuali
  • Stampa
  • Pagina
    / 27
  • Indice
  • SEGNALIBRI
  • Valutato. / 5. Basato su recensioni clienti
Vedere la pagina 22
502Testing
package
{
import net.digitalprimates.fluint.tests.TestCase;
public class testCase
extends net.digitalprimates.fluint.tests.TestCase
{
public function testMilesToKm():void
{
var mph:Number = 65;
var kmh:Number = speedConverter.toKmh( mph );
assertEquals( 104,kmh);
}
public function testKmToMiles():void
{
var kmh:Number =104;
var mph:Number = speedConverter.toMph( kmh );
assertEquals( 65,mph);
}
}
}
You have the test runner, which is the foundation; you have the test cases coded; and
now you just need to add the test cases to test suites.
CREATING TEST SUITES
A Fluint test suite does one simple thing: it adds all the test cases that are needed as
part of the test suite. It too is an ActionScript class.
If you look back at listing 23.10, when creating the test runner, you added a test
suite called
testSuite
:
suiteArray.push( new testSuite() );
That file looks something like listing 23.12.
package
{
import net.digitalprimates.fluint.tests.TestSuite;
public class testSuite
extends net.digitalprimates.fluint.tests.TestSuite
{
public function testSuite()
{
addTestCase( new testCase() );
}
}
}
Listing 23.11 testCase.as: Creating Fluint test cases
Listing 23.12 testSuite.as: Adding test cases to the Fluint test suite
Create all
test cases
Add all cases
to test
Add all cases
to test
Vedere la pagina 22
1 2 ... 18 19 20 21 22 23 24 25 26 27

Commenti su questo manuale

Nessun commento