Esempio n. 1
0
        private static void TestTagDescriptionFactoryMethods()
        {
            ID3.Version[] versions = ID3.Version.Versions;

            for (int i = 0; i < versions.Length; i++)
            {
                TagDescription tgm = TagDescriptionMap.Instance[versions[i]];

                UnitTest.Test(tgm.CreateTagCodec().IsSupported(versions[i]));
                UnitTest.Test(tgm.CreateFrameCodec().IsSupported(versions[i]));

                foreach (FrameDescription.FrameType frameType
                         in Enum.GetValues(typeof(FrameDescription.FrameType)))
                {
                    ID3.FrameContent content = tgm.CreateContent(frameType);

                    UnitTest.Test(content.Type == frameType || content.Type == FrameDescription.FrameType.Binary);
                }

                foreach (FrameDescription.FrameType frameType
                         in Enum.GetValues(typeof(FrameDescription.FrameType)))
                {
                    ID3.Codec.FrameContentCodecBase codec = tgm.CreateContentCodec(frameType);

                    UnitTest.Test(codec.Type == frameType || codec.Type == FrameDescription.FrameType.Binary);
                    UnitTest.Test(codec.IsSupported(versions[i]));
                }
            }
        }
Esempio n. 2
0
 public Tag(TagDescription descriptionMap)
     : this(descriptionMap.CreateTagCodec())
 {
     DescriptionMap = descriptionMap;
 }