Title: Unit 7 - Using Suites

Download Unit Project Files

[Suite]
[RunWith("org.flexunit.runners.Suite")]
public class SampleSuite {
	public var testCase:TestCase;
	public var anotherTestCase:AnotherTestCase;
	public var yetAnotherTestCase:YetAnotherTestCase;
	public var anotherSuite:AnotherSuite;
}
package math.testcases {
	public class CircleConstructorTest {		
	}
}
public class CircleConstructorTest {		
	[Test(expects="RangeError")]
	public function shouldThrowRangeError():void {
		trace("Test");
		var someCircle:Circle = 
			new Circle( new Point( 10, 10 ), -5 );
	}
}

package flexUnitTests.cases {
	import flash.geom.Point;
	import net.digitalprimates.math.Circle;
	public class CircleConstructorTest {
		[Test(expects="RangeError")]
		public function shouldThrowRangeError():void {
			var someCircle:Circle = 
                          new Circle( new Point( 10, 10 ), -5 );
		}
	}
}
[Suite]
[RunWith("org.flexunit.runners.Suite")]
public class mySuite
[Suite]
[RunWith("org.flexunit.runners.Suite")]
public class MySuite {
	public var testCase:TestCase;
	public var anotherTestCase:AnotherTestCase;
	public var yetAnotherTestCase:YetAnotherTestCase;
	public var anotherSuite:AnotherSuite;
}
[Suite]
[RunWith("org.flexunit.runners.Suite")]
public class CircleSuite {
...
}
[Suite]
[RunWith("org.flexunit.runners.Suite")]
public class CircleSuite {
	public var test1:BasicCircleTest;
	public var test2:CircleConstructorTest;
}
testsToRun.push( BasicCircleTest );
testsToRun.push( CircleSuite );
import tests.children.ChildrenSuite;
import tests.father.FatherSuite;
import tests.mother.MotherSuite;
[Suite]
[RunWith("org.flexunit.runners.Suite")]
public class FamilySuite {		
	public var fatherSuite:FatherSuite;
	public var motherSuite:MotherSuite;
	public var childrenSuite:ChildrenSuite;
}