Merge pull request #1055 from toopay/unit-tests

Unit tests