Please note : This help page is not for the latest version of Enterprise Architect. The latest help can be found here.

Set Up Unit Testing

In order to use unit testing in Enterprise Architect, you must first set it up. This happens in two parts.

Firstly the appropriate tests must be defined. Enterprise Architect is able to help with this. By using the JUnit or NUnit transformations and code generation you can create test method stubs for all of the public methods in each of your Classes.

The following is an NUnit example in C# that is followed through the rest of this topic, although it could also be any other .Net language or Java and JUnit.


public class CalculatorTest




       public void testAdd(){





       public void testDivide(){





       public void testMultiply(){





       public void testSubtract(){




This code can be reverse engineered into Enterprise Architect so that Enterprise Architect can record all test results against this Class.

Once the unit tests are set up, you can then set up the Build and Test scripts to run the tests. These scripts must be set up against a package.

The sample above can be called by setting up the Package Build Scripts dialog as follows.


If Enterprise Architect is to handle unit testing, it is important that you select the Capture Output checkbox and select the appropriate Output Parser for the testing. Without doing this you won't see the program output and therefore you cannot open the source at the appropriate location.