added test for ToBinary()