Sample CDK Project Unit Tests

Sample test code, when executed, only makes changes to the ScribeSampleRSSource database. The test code does not alter any other files.

Some tests can only be run once per database refresh to return useful results. For example, a delete test deletes a database record, which cannot be deleted again.

To refresh the sample database between tests, repeat Step 3 in Setting Up The Sample Database.

Test Connectors make changes to both Source and Target databases:

  • The source tests create a trigger for a specified table. This trigger updates the change history table with information about each deleted row in the source database. The test code also deletes rows from the change history table once the deleted information has been sent to the target.
  • The target requires an empty SQL database in a location that can be accessed and discovered by the sample test code. This database must be referenced in the connection information parameter through the connect method. The target has the ability to create and update table schema, as well as perform all create-read-update-delete (CRUD) operations.

See Also

Unit Testing