ported unit tests to support new encoding interface