Create unit test, helpers and mocking. Issue #114

fully tested