Friday, March 2, 2007

Unit Testing with Test Data

Some tests will require test data, for example creating a Map Series requires a valid layer as input. To solve this I added a registry value that indicates where test data is located.

The test data directory must contain a specific set of pre-defined test data.
UT_RB_Empty.mdb is an empty Rulebase that will be copied to UT_RB_test.mdb before the tests are started. The Rulebase value in registry will change so that it points to the UT_RB_test.mdb. After the tests are completed it will revert back the whatever the Rulebase value was before the tests where started.

UT_MS_01.shp is a shapefile that can be used for testing Map Series.

Example of test, Creating a Map Series
  1. Create a layer using the UT_MS_01 shapefile
  2. Create the Map Series and set properties
  3. Assign the layer to the Map Series
  4. Verify that the Map Series contain eight Maps (number of polygons in UT_MS_01 shapefile)
  5. Filtering Maps using "D" should return one Map (PageName of polygon in UT_MS_01 shapefile)

1 comment:

RH said...

Very good idea! We may also want to store data that is the expected result of some operation, such as a PDF from output and then compare (File Compare, Feature Compare) the test results with this.