예제 #1
0
        public void TestClear()
        {
            var tag = new TagLib.Riff.InfoTag {
                Title             = "A",
                Performers        = new[] { "B" },
                AlbumArtists      = new[] { "C" },
                Composers         = new[] { "D" },
                Album             = "E",
                Comment           = "F",
                Genres            = new[] { "Blues" },
                Year              = 123,
                Track             = 234,
                TrackCount        = 234,
                Disc              = 234,
                DiscCount         = 234,
                Lyrics            = "G",
                Grouping          = "H",
                BeatsPerMinute    = 234,
                Conductor         = "I",
                Copyright         = "J",
                Pictures          = new[] { new Picture(TestPath.Covers + "sample_a.png") },
                Timecode          = "10:30:20:01",
                TimecodeFrequency = "30",
                Software          = "taglib_sharp",
                DateTagged        = new DateTime(2000, 1, 2, 10, 11, 12)
            };


            Assert.IsFalse(tag.IsEmpty, "Should be full.");
            tag.Clear();

            Assert.IsNull(tag.Title, "Title");
            Assert.AreEqual(0, tag.Performers.Length, "Performers");
            Assert.AreEqual(0, tag.AlbumArtists.Length, "AlbumArtists");
            Assert.AreEqual(0, tag.Composers.Length, "Composers");
            Assert.IsNull(tag.Album, "Album");
            Assert.IsNull(tag.Comment, "Comment");
            Assert.AreEqual(0, tag.Genres.Length, "Genres");
            Assert.AreEqual(0, tag.Year, "Year");
            Assert.AreEqual(0, tag.Track, "Track");
            Assert.AreEqual(0, tag.TrackCount, "TrackCount");
            Assert.AreEqual(0, tag.Disc, "Disc");
            Assert.AreEqual(0, tag.DiscCount, "DiscCount");
            Assert.IsNull(tag.Lyrics, "Lyrics");
            Assert.IsNull(tag.Comment, "Comment");
            Assert.AreEqual(0, tag.BeatsPerMinute, "BeatsPerMinute");
            Assert.IsNull(tag.Conductor, "Conductor");
            Assert.IsNull(tag.Copyright, "Copyright");
            Assert.AreEqual(0, tag.Pictures.Length, "Pictures");
            Assert.IsNull(tag.Timecode, "Timecode");
            Assert.IsNull(tag.TimecodeFrequency, "TimecodeFrequency");
            Assert.IsNull(tag.Software, "Software");
            Assert.IsNull(tag.DateTagged, "DateTagged");
            Assert.IsTrue(tag.IsEmpty, "Should be empty.");
        }
예제 #2
0
        public void TestClear()
        {
            var tag = new TagLib.Riff.InfoTag {
                Title          = "A",
                Performers     = new[] { "B" },
                AlbumArtists   = new[] { "C" },
                Composers      = new[] { "D" },
                Album          = "E",
                Comment        = "F",
                Genres         = new[] { "Blues" },
                Year           = 123,
                Track          = 234,
                TrackCount     = 234,
                Disc           = 234,
                DiscCount      = 234,
                Lyrics         = "G",
                Grouping       = "H",
                BeatsPerMinute = 234,
                Conductor      = "I",
                Copyright      = "J",
                Pictures       = new[] { new Picture(TestPath.Covers + "sample_a.png") }
            };


            Assert.IsFalse(tag.IsEmpty, "Should be full.");
            tag.Clear();

            Assert.IsNull(tag.Title, "Title");
            Assert.AreEqual(0, tag.Performers.Length, "Performers");
            Assert.AreEqual(0, tag.AlbumArtists.Length, "AlbumArtists");
            Assert.AreEqual(0, tag.Composers.Length, "Composers");
            Assert.IsNull(tag.Album, "Album");
            Assert.IsNull(tag.Comment, "Comment");
            Assert.AreEqual(0, tag.Genres.Length, "Genres");
            Assert.AreEqual(0, tag.Year, "Year");
            Assert.AreEqual(0, tag.Track, "Track");
            Assert.AreEqual(0, tag.TrackCount, "TrackCount");
            Assert.AreEqual(0, tag.Disc, "Disc");
            Assert.AreEqual(0, tag.DiscCount, "DiscCount");
            Assert.IsNull(tag.Lyrics, "Lyrics");
            Assert.IsNull(tag.Comment, "Comment");
            Assert.AreEqual(0, tag.BeatsPerMinute, "BeatsPerMinute");
            Assert.IsNull(tag.Conductor, "Conductor");
            Assert.IsNull(tag.Copyright, "Copyright");
            Assert.AreEqual(0, tag.Pictures.Length, "Pictures");
            Assert.IsTrue(tag.IsEmpty, "Should be empty.");
        }