Ejemplo n.º 1
0
		public void TestAlbum ()
		{
			Id3v1.Tag tag = new Id3v1.Tag ();

			Assert.IsTrue (tag.IsEmpty, "Initially empty");
			Assert.IsNull (tag.Album, "Initially null");

			ByteVector rendered = tag.Render ();
			tag = new Id3v1.Tag (rendered);
			Assert.IsTrue (tag.IsEmpty, "Still empty");
			Assert.IsNull (tag.Album, "Still null");

			tag.Album = "01234567890123456789012345678901234567890123456789";
			Assert.IsFalse (tag.IsEmpty, "Not empty");
			Assert.AreEqual ("01234567890123456789012345678901234567890123456789", tag.Album);

			rendered = tag.Render ();
			tag = new Id3v1.Tag (rendered);
			Assert.IsFalse (tag.IsEmpty, "Still not empty");
			Assert.AreEqual ("012345678901234567890123456789", tag.Album);

			tag.Album = string.Empty;
			Assert.IsTrue (tag.IsEmpty, "Again empty");
			Assert.IsNull (tag.Album, "Again null");

			rendered = tag.Render ();
			tag = new Id3v1.Tag (rendered);
			Assert.IsTrue (tag.IsEmpty, "Still empty");
			Assert.IsNull (tag.Album, "Still null");
		}
Ejemplo n.º 2
0
		public void TestPerformers ()
		{
			Id3v1.Tag tag = new Id3v1.Tag ();

			Assert.IsTrue (tag.IsEmpty, "Initially empty");
			Assert.AreEqual (0, tag.Performers.Length, "Initially empty");

			ByteVector rendered = tag.Render ();
			tag = new Id3v1.Tag (rendered);
			Assert.IsTrue (tag.IsEmpty, "Still empty");
			Assert.AreEqual (0, tag.Performers.Length, "Still empty");

			tag.Performers = new string [] {"A123456789", "B123456789", "C123456789", "D123456789", "E123456789"};
			Assert.IsFalse (tag.IsEmpty, "Not empty");
			Assert.AreEqual ("A123456789; B123456789; C123456789; D123456789; E123456789", tag.JoinedPerformers);

			rendered = tag.Render ();
			tag = new Id3v1.Tag (rendered);
			Assert.IsFalse (tag.IsEmpty, "Still not empty");
			Assert.AreEqual ("A123456789; B123456789; C1234567", tag.JoinedPerformers);

			tag.Performers = new string [0];
			Assert.IsTrue (tag.IsEmpty, "Again empty");
			Assert.AreEqual (0, tag.Performers.Length, "Again empty");

			rendered = tag.Render ();
			tag = new Id3v1.Tag (rendered);
			Assert.IsTrue (tag.IsEmpty, "Still empty");
			Assert.AreEqual (0, tag.Performers.Length, "Still empty");
		}
Ejemplo n.º 3
0
		public void TestTrack ()
		{
			Id3v1.Tag tag = new Id3v1.Tag ();

			Assert.IsTrue (tag.IsEmpty, "Initially empty");
			Assert.AreEqual (0, tag.Track, "Initially zero");

			ByteVector rendered = tag.Render ();
			tag = new Id3v1.Tag (rendered);
			Assert.IsTrue (tag.IsEmpty, "Still empty");
			Assert.AreEqual (0, tag.Track, "Still zero");

			tag.Track = 123;
			Assert.IsFalse (tag.IsEmpty, "Not empty");
			Assert.AreEqual (123, tag.Track);

			rendered = tag.Render ();
			tag = new Id3v1.Tag (rendered);
			Assert.IsFalse (tag.IsEmpty, "Still not empty");
			Assert.AreEqual (123, tag.Track);

			tag.Track = 0;
			Assert.IsTrue (tag.IsEmpty, "Again empty");
			Assert.AreEqual (0, tag.Track, "Again zero");

			rendered = tag.Render ();
			tag = new Id3v1.Tag (rendered);
			Assert.IsTrue (tag.IsEmpty, "Still empty");
			Assert.AreEqual (0, tag.Track, "Still zero");
		}
Ejemplo n.º 4
0
		public void TestGenres ()
		{
			Id3v1.Tag tag = new Id3v1.Tag ();

			Assert.IsTrue (tag.IsEmpty, "Initially empty");
			Assert.AreEqual (0, tag.Genres.Length, "Initially empty");

			ByteVector rendered = tag.Render ();
			tag = new Id3v1.Tag (rendered);
			Assert.IsTrue (tag.IsEmpty, "Still empty");
			Assert.AreEqual (0, tag.Genres.Length, "Still empty");

			tag.Genres = new string [] {"Rap", "Jazz", "Non-Genre", "Blues"};
			Assert.IsFalse (tag.IsEmpty, "Not empty");
			Assert.AreEqual ("Rap", tag.JoinedGenres);

			rendered = tag.Render ();
			tag = new Id3v1.Tag (rendered);
			Assert.IsFalse (tag.IsEmpty, "Still not empty");
			Assert.AreEqual ("Rap", tag.JoinedGenres);

			tag.Genres = new string [] {"Non-Genre"};
			Assert.IsTrue (tag.IsEmpty, "Surprisingly empty");
			Assert.AreEqual (0, tag.Genres.Length, "Surprisingly empty");

			rendered = tag.Render ();
			tag = new Id3v1.Tag (rendered);
			Assert.IsTrue (tag.IsEmpty, "Still empty");
			Assert.AreEqual (0, tag.Genres.Length, "Still empty");

			tag.Genres = new string [0];
			Assert.IsTrue (tag.IsEmpty, "Again empty");
			Assert.AreEqual (0, tag.Genres.Length, "Again empty");

			rendered = tag.Render ();
			tag = new Id3v1.Tag (rendered);
			Assert.IsTrue (tag.IsEmpty, "Still empty");
			Assert.AreEqual (0, tag.Genres.Length, "Still empty");
		}
Ejemplo n.º 5
0
		public void TestYear ()
		{
			Id3v1.Tag tag = new Id3v1.Tag ();

			Assert.IsTrue (tag.IsEmpty, "Initially empty");
			Assert.AreEqual (0, tag.Year, "Initially zero");

			ByteVector rendered = tag.Render ();
			tag = new Id3v1.Tag (rendered);
			Assert.IsTrue (tag.IsEmpty, "Still empty");
			Assert.AreEqual (0, tag.Year, "Still zero");

			tag.Year = 1999;
			Assert.IsFalse (tag.IsEmpty, "Not empty");
			Assert.AreEqual (1999, tag.Year);

			rendered = tag.Render ();
			tag = new Id3v1.Tag (rendered);
			Assert.IsFalse (tag.IsEmpty, "Still not empty");
			Assert.AreEqual (1999, tag.Year);

			tag.Year = 20000;
			Assert.IsTrue (tag.IsEmpty, "Again empty");
			Assert.AreEqual (0, tag.Year, "Again zero");

			rendered = tag.Render ();
			tag = new Id3v1.Tag (rendered);
			Assert.IsTrue (tag.IsEmpty, "Still empty");
			Assert.AreEqual (0, tag.Year, "Still zero");
		}