decode and unit test