public void testShouldConvertFrameDataWithNoDescriptionToBytesAndBackToEquivalentObject() throws Exception { ID3v2UrlFrameData frameData = new ID3v2UrlFrameData(false, new EncodedText(""), TEST_URL); byte[] bytes = frameData.toBytes(); byte[] expectedBytes = { 0, 0, 'h', 't', 't', 'p', ':', '/', '/', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q' }; assertTrue(Arrays.equals(expectedBytes, bytes)); ID3v2UrlFrameData frameDataCopy = new ID3v2UrlFrameData(false, bytes); assertEquals(frameData, frameDataCopy); }
public void testShouldConvertFrameDataWithUnicodeDescriptionToBytesAndBackToEquivalentObject() throws Exception { ID3v2UrlFrameData frameData = new ID3v2UrlFrameData( false, new EncodedText(EncodedText.TEXT_ENCODING_UTF_16, TEST_DESCRIPTION_UNICODE), TEST_URL); byte[] bytes = frameData.toBytes(); byte[] expectedBytes = { 1, (byte) 0xff, (byte) 0xfe, (byte) 0xb3, 0x03, (byte) 0xb5, 0x03, (byte) 0xb9, 0x03, (byte) 0xac, 0x03, 0, 0, 'h', 't', 't', 'p', ':', '/', '/', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q' }; assertTrue(Arrays.equals(expectedBytes, bytes)); ID3v2UrlFrameData frameDataCopy = new ID3v2UrlFrameData(false, bytes); assertEquals(frameData, frameDataCopy); }