Example #1
0
        private static void TestFrame(IFrame frame, ID3v2TagVersion tagVersion, byte[] data)
        {
            TagReadingInfo tagReadingInfo = new TagReadingInfo(tagVersion);
            Stream         stream         = GetFrame(tagVersion, data);

            frame.Read(tagReadingInfo, stream);

            byte[] data2  = frame.GetBytes(tagVersion);
            int    offset = (tagVersion == ID3v2TagVersion.ID3v22 ? 6 : 10);

            Assert.AreEqual(data.Length, data2.Length - offset, "Frame sizes are different");

            for (int i = 0; i < data.Length; i++)
            {
                Assert.AreEqual(data[i], data2[i + offset], string.Format("Byte offset {0}", i + offset));
            }
        }
Example #2
0
        private static void TestFrame(IFrame frame, ID3v2TagVersion tagVersion, byte[] data)
        {
            TagReadingInfo tagReadingInfo = new TagReadingInfo(tagVersion);
            Stream stream = GetFrame(tagVersion, data);

            frame.Read(tagReadingInfo, stream);

            byte[] data2 = frame.GetBytes(tagVersion);
            int offset = (tagVersion == ID3v2TagVersion.ID3v22 ? 6 : 10);

            Assert.AreEqual(data.Length, data2.Length - offset, "Frame sizes are different");

            for (int i = 0; i < data.Length; i++)
            {
                Assert.AreEqual(data[i], data2[i + offset], string.Format("Byte offset {0}", i + offset));
            }
        }