예제 #1
0
파일: TagUtils.cs 프로젝트: MRoc/puremp3
        private static void TestTagUtilsRewrite()
        {
            byte[] data     = new byte[] { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11 };
            string fileName = VirtualDrive.VirtualFileName("TestID3TagUtilsRewrite\\t0.mp3");

            Id3FileUtils.SaveFileBinary(fileName, data);

            TagUtils.Rewrite(new FileInfo(fileName), 4, 3, 2, 1);

            Stream s = VirtualDrive.OpenInStream(fileName);

            UnitTest.Test(s.ReadByte() == 0);
            UnitTest.Test(s.ReadByte() == 0);
            UnitTest.Test(s.ReadByte() == 4);
            UnitTest.Test(s.ReadByte() == 5);
            UnitTest.Test(s.ReadByte() == 6);
            UnitTest.Test(s.ReadByte() == 7);
            UnitTest.Test(s.ReadByte() == 8);
            UnitTest.Test(s.ReadByte() == 0);
            UnitTest.Test(s.ReadByte() == -1);
            s.Close();
        }