Issue #114: create unit test, helpers and mocking

fully tested