Add auto tests for metrics (#939)
- Adds mechanism to auto test metric. When creating a metric you now create a json file with test cases (input, output and expected results).
- move unit test to a tests/unit folder.
- fix broken metrics
---------
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>