Program Unit Tests

Program unit tests enable you to organize your test code as described in Best Practice for Organizing Projects.

Program unit tests are contained in test programs, within a unit test library project, and have the ability to call other programs within a solution, thus allowing you to directly run the code at source, and then make test assertions based on the results from that code.

When using the Create Unit Test wizard to create a program unit test, you can select the program or program entry point of your source code and the wizard will add the necessary syntax to call into that code and use its data.

The test program in which the program unit test is created can contain other program unit tests calling into the same source. Additional test programs, containing further program unit tests can be created within the project, but we recommend that they all call into the same source program, as during a test run, the test programs use the output folder specified in the project containing the source program.

When writing your program unit tests, you can utilize all the conventional elements of a test case (see Elements of a Test Case),