For tests to be able to run, API public and private keys need to be entered into the TestKeys.cs file.
The library comes with a unit test for the general case of each API method, but some will initially be inconclusive, while others will seemingly fail at random. Why this happens is described as follows:
Some tests require a job to be set to the 'Reviewable' state in the Gengo Sandbox as there is currently no way of doing this programmatically. These tests are specifically:
- TestApproveJob
- TestGetPreview
- TestReturnForSubmission
Job submission and certain other methods are processed asynchronously by the Gengo servers. This means that there is a non-deterministic delay before methods that query and manipulate jobs/orders will behave as expected.
In these cases, the affected unit tests have Thread.Sleeps with pragmatic delays scatted around, but may still fail randomly based on current server load. Repeat offenders include:
- TestCreateGetAndDeleteOrder
- TestGetJobGroup
There is no test for the method for rejecting a job, as this requires solving a captcha.