hascode unit test