Beispiel #1
0
        private static void TestTagUtilsWriteTagSmallerExact()
        {
            Tag   tag = TagUtils.RawToTag(TestTags.demoTag2_3);
            Frame f   = new Frame(tag.DescriptionMap, "MCDI");

            (f.Content as FrameContentBinary).Content = new byte[1024];
            tag.Add(f);

            string fileName = VirtualDrive.VirtualFileName("TestTagUtilsWriteTagSmallerExact\\t1.mp3");

            TestTags.WriteDemoMp3(fileName, TagUtils.TagToRaw(tag));

            tag.Remove(f);
            FileInfo fileInfo = new FileInfo(fileName);

            TagUtils.WriteTagV2(tag, fileInfo, Rewriter.Strategy.Exact);
            UnitTest.Test(VirtualDrive.FileLength(fileName) == TagUtils.TagToRaw(tag).Length + TestTags.mpegDummy.Length);
            TagUtils.StripTagV2(fileInfo, 0);
            UnitTest.Test(ArrayUtils.IsEqual(VirtualDrive.Load(fileName), TestTags.mpegDummy));
        }