bug #770 - unittests added

https://gist.github.com/aprzybyszewska/a2efb20a5200007c1a27