update test suite to use encode method