Ejemplo n.º 1
0
 public virtual void TestShouldConvert23TagToBytesAndBackToEquivalentTag()
 {
     ID3v2 id3tag = new ID3v23Tag();
     SetTagFields(id3tag);
     byte[] data = id3tag.ToBytes();
     ID3v2 id3tagCopy = new ID3v23Tag(data);
     Assert.AreEqual(2131, data.Length);
     Assert.AreEqual(id3tag, id3tagCopy);
 }
Ejemplo n.º 2
0
 public virtual void TestShouldSetCombinedGenreOnTag()
 {
     ID3v2 id3tag = new ID3v23Tag();
     SetTagFields(id3tag);
     IDictionary<string, ID3v2FrameSet> frameSets = id3tag.GetFrameSets();
     ID3v2FrameSet frameSet = (ID3v2FrameSet)frameSets.Get("TCON");
     IList<ID3v2Frame> frames = frameSet.GetFrames();
     ID3v2Frame frame = (ID3v2Frame)frames[0];
     byte[] bytes = frame.GetData();
     string genre = BufferTools.ByteBufferToString(bytes, 1, bytes.Length - 1);
     Assert.AreEqual("(13)Pop", genre);
 }
Ejemplo n.º 3
0
 public virtual void TestShouldSetTagFieldsWithUnicodeDataAndSpecifiedEncodingCorrectly()
 {
     ID3v2 id3tag = new ID3v23Tag();
     id3tag.SetArtist("\u03B3\u03B5\u03B9\u03AC \u03C3\u03BF\u03C5");
     id3tag.SetTitle("\u4E2D\u6587");
     id3tag.SetAlbum("\u3053\u3093\u306B\u3061\u306F");
     id3tag.SetComment("\u03C3\u03BF\u03C5");
     id3tag.SetComposer("\u0AB9\u0AC7\u0AB2\u0ACD\u0AB2\u0ACB");
     id3tag.SetOriginalArtist("\u03B3\u03B5\u03B9\u03AC");
     id3tag.SetCopyright("\u03B3\u03B5");
     id3tag.SetUrl("URL");
     id3tag.SetEncoder("\u03B9\u03AC");
     byte[] albumImage = TestHelper.LoadFile("Resources/image.png");
     id3tag.SetAlbumImage(albumImage, "image/png");
 }
Ejemplo n.º 4
0
 public virtual void TestShouldReadCombinedGenreInTag()
 {
     ID3v2 id3tag = new ID3v23Tag();
     SetTagFields(id3tag);
     byte[] bytes = id3tag.ToBytes();
     ID3v2 id3tagFromData = new ID3v23Tag(bytes);
     Assert.AreEqual(13, id3tagFromData.GetGenre());
     Assert.AreEqual("Pop", id3tagFromData.GetGenreDescription());
 }