#592 added tests

Resolved #592