Remove code duplication in converter test.