You will receive access to a new repository with the API designed by another team. Your task is to write tests against the public API and setup CI for the project. This task is done individually, which means that you should receive two sets of tests for your API.

Unit tests

The purpose of this task is to practise writing unit tests against a public API without knowing the implementation (i.e. blackbox style testing). Your tests should cover all the functionality provided by the library — review the API requirements from task 1, check whether the library provides some extra functionality and write the tests.

Use a well-known unit testing framework that nicely integrates with the language. Use the requirements from task 1 to define the expected behaviour in the tests. If the requirements do not clearly define some behavior, check if the API defines it (in example client code or in documentation) and write tests according to that. If in doubt, define the expected behavior yourself using the tests. Do not forget to test for expected failures (i.e., error codes returned or exceptions thrown) too.

Obviously, because there is no implementation, your tests will fail. While that can be a bit discouraging, a failing test is also the primary driving force in Test Driven Development, because it makes the expected behavior explicit and thus makes it clear what needs to be implemented.

We intentionally do not provide any metrics on how many tests you should provide. Use common sense to provide a reasonable set of tests that would help your colleagues when writing the implementation.

CI in GitLab

Your second task is to setup a simple CI for the project. Simply stated, configure the project so that unit tests are executed automatically on each commit (push) to GitLab.

If you have never configured CI in GitLab, we suggest to consult a reference manual and examples for unit testing.