using System;
using NUnit.Framework;
using TagLib;

namespace TagLib.Tests.FileFormats
{   
    [TestFixture]
    public class Id3V24FormatTest : IFormatTest
    {
		private static string sample24unsynchronization_file = "samples/sample_v2_4_unsynch.mp3";

        private static string tmp_file = "samples/tmpwrite_v2_4_unsynch.mp3";
        private File file;
        
        [TestFixtureSetUp]
        public void Init()
        {
			file = File.Create(sample24unsynchronization_file);
        }
    
        [Test]
        public void ReadAudioProperties()
        {
            Assert.AreEqual(44100, file.Properties.AudioSampleRate);
            Assert.AreEqual(1, file.Properties.Duration.Seconds);
        }
        
        [Test]
        public void ReadTags()
        {
			Assert.AreEqual("MP3 album", file.Tag.Album);
			Assert.That(file.Tag.Comment, Is.StringStarting("MP3 comment"));
			CollectionAssert.AreEqual(file.Tag.Genres, new[] { "Acid Punk" });
			CollectionAssert.AreEqual(file.Tag.Performers, new[] { "MP3 artist unicode (ኃይሌ ገብረሥላሴ)" });
			CollectionAssert.AreEqual(file.Tag.Composers, new[] { "MP3 composer" });
			Assert.AreEqual("MP3 title unicode (ኢትዮጵያ)", file.Tag.Title);
            Assert.AreEqual(6, file.Tag.Track);
            Assert.AreEqual(7, file.Tag.TrackCount);
            Assert.AreEqual(1234, file.Tag.Year);
        }
        
        [Test]
        public void WriteStandardTags ()
        {
			StandardTests.WriteStandardTags(sample24unsynchronization_file, tmp_file);
        }
		public void TestCorruptionResistance() {

		}
	}
}
