Esempio n. 1
0
        public void ConvertISO8859()
        {
            var encoding = Encoding.Default;
            const string mimeType = "ABCD";
            const PictureType pictureType = PictureType.CoverFront;
            const string description = "EFGH";
            var data = new byte[] {0x20, 0x21, 0x22, 0x23};

            var pictureFrame = new PictureFrame(encoding, mimeType, description, pictureType, data);
            var rawFrame = pictureFrame.Convert(TagVersion.Id3V23);

            var refBytes = new byte[]
                               {
                                   0x00, 0x41, 0x42, 0x43, 0x44, 0x00, 0x03, 0x45, 0x46, 0x47, 0x48, 0x00,
                                   0x20, 0x21, 0x22, 0x23
                               };

            Assert.IsTrue(ComparePayload(rawFrame.Payload, refBytes));
        }
Esempio n. 2
0
        public void ConvertUTF16()
        {
            const TextEncodingType encoding = TextEncodingType.UTF16;
            const string mimeType = "ABCD";
            const PictureType pictureType = PictureType.CoverFront;
            const string description = "EFGH";
            var data = new byte[] {0x20, 0x21, 0x22, 0x23};

            var pictureFrame = new PictureFrame(encoding, mimeType, description, pictureType, data);
            var rawFrame = pictureFrame.Convert();

            var refBytes = new byte[]
                               {
                                   0x01, 0x41, 0x42, 0x43, 0x44, 0x00, 0x03, 0xFF, 0xFE, 0x45, 0x00, 0x46, 0x00, 0x47,
                                   0x00, 0x48, 0x00, 0x00, 0x00,
                                   0x20, 0x21, 0x22, 0x23
                               };

            Assert.IsTrue(ComparePayload(rawFrame.Payload, refBytes));
        }