Test cases for encoding records