Add thorough tests

[ID-302]