public void ConverterISO88591_Test() { var textFrame = new TextFrame { TextEncoding = TextEncodingType.ISO_8859_1, Content = "ABCD", Descriptor = {ID = "TALB"} }; var rawFrame = textFrame.Convert(); Assert.AreEqual(rawFrame.ID, "TALB"); Assert.AreEqual(rawFrame.Payload[0], 0); // ISO_8859 coding Assert.AreEqual(rawFrame.Payload.Length, 5); }
public void ConverterISO88591_Test() { var textFrame = new TextFrame { TextEncoding = Encoding.Default, Content = "ABCD", Descriptor = {ID = "TALB"} }; var rawFrame = textFrame.Convert(TagVersion.Id3V23); Assert.AreEqual(rawFrame.ID, "TALB"); Assert.AreEqual(rawFrame.Payload[0], 0); // ISO_8859 coding Assert.AreEqual(rawFrame.Payload.Length, 5); }
public void ConverterUTF16_Test() { var textFrame = new TextFrame { TextEncoding = TextEncodingType.UTF16, Content = "ABCD", Descriptor = {ID = "TALB"} }; var rawFrame = textFrame.Convert(); Assert.AreEqual(rawFrame.ID, "TALB"); Assert.AreEqual(rawFrame.Payload[0], 1); // UTF 16 Assert.AreEqual(rawFrame.Payload[1], 0xFF); // BOM 1 Assert.AreEqual(rawFrame.Payload[2], 0xFE); // BOM 2 Assert.AreEqual(rawFrame.Payload.Length, 11); }
public void ConverterUTF16BE_Test() { var textFrame = new TextFrame { TextEncoding = TextEncodingType.UTF16_BE, Content = "ABCD", Descriptor = {ID = "TALB"} }; var rawFrame = textFrame.Convert(); Assert.AreEqual(rawFrame.ID, "TALB"); var refBytes = new byte[] { 0x02, 0x00, 0x41, 0x00, 0x42, 0x00, 0x43, 0x00, 0x44 }; Assert.IsTrue(ComparePayload(rawFrame.Payload, refBytes)); }
public void ConverterUTF16BE_Test() { var textFrame = new TextFrame { TextEncoding = new UnicodeEncoding(true, false), Content = "ABCD", Descriptor = {ID = "TALB"} }; var rawFrame = textFrame.Convert(TagVersion.Id3V23); Assert.AreEqual(rawFrame.ID, "TALB"); var refBytes = new byte[] { 0x02, 0x00, 0x41, 0x00, 0x42, 0x00, 0x43, 0x00, 0x44 }; Assert.IsTrue(ComparePayload(rawFrame.Payload, refBytes)); }