示例#1
0
        private static void TestGenericCodecUserText2_0And2_3BinaryAttached()
        {
            byte[] data =
            {
                (byte)1,
                0xFF,    0xFE, (byte)'T', 0, (byte)'0', 0, 0, 0,
                0xFF,    0xFE, (byte)'T', 0, (byte)'1', 0, 0, 0,0x1, 0x2, 0x3
            };

            foreach (Version v in Version.vs2_0And2_3)
            {
                var fc = new FrameContentUserText(TagDescriptionMap.Instance[v]);

                TestCodec(data, fc, false);

                UnitTest.Test((fc.Codec as FrameContentCodecGeneric).CurrentTextCodec == 1);
                UnitTest.Test(fc.Description == "T0");
                UnitTest.Test(fc.Texts.Count() == 1);
                UnitTest.Test(fc.Texts.ElementAt(0) == "T1");
            }
        }
示例#2
0
        private static void TestGenericCodecUserText2_4()
        {
            byte[] data =
            {
                (byte)0,
                (byte)'D',(byte)'e',  (byte)'s', (byte)'c', (byte)0,
                (byte)'T',(byte)'e',  (byte)'x', (byte)'t', (byte)'0',(byte)0,
                (byte)'T',(byte)'e',  (byte)'x', (byte)'t', (byte)'1'
            };

            foreach (Version v in Version.vs2_4)
            {
                var fc = new FrameContentUserText(TagDescriptionMap.Instance[v]);

                TestCodec(data, fc);

                UnitTest.Test((fc.Codec as FrameContentCodecGeneric).CurrentTextCodec == 0);
                UnitTest.Test(fc.Description == "Desc");
                UnitTest.Test(fc.Texts.Count() == 2);
                UnitTest.Test(fc.Texts.ElementAt(0) == "Text0");
                UnitTest.Test(fc.Texts.ElementAt(1) == "Text1");
            }
        }