Exemple #1
0
        private void TestTextFrame(TextFrame frame, EncodingScheme encoding, ID3v2MajorVersion version)
        {
            string             frameId;
            FrameParserFactory factory = new FrameParserFactory();
            FrameWriter        writer  = frame.CreateWriter(version, encoding);

            if (writer == null)
            {
                return;
            }
            MemoryStream stream = new MemoryStream();


            writer.WriteToStream(stream);
            stream.Seek(0, SeekOrigin.Begin);

            Frame writtenFrame = FrameParser.Parse(stream, version, factory, out frameId);

            Assert.IsInstanceOfType(frame, writtenFrame.GetType());
            TextFrame textFrame = (TextFrame)writtenFrame;

            Assert.AreEqual(textFrame.Text, frame.Text);
        }