Skip to content

Commit

Permalink
ID3v2 : Unit test for manual edit of WXXX field
Browse files Browse the repository at this point in the history
  • Loading branch information
Zeugma440 committed Aug 26, 2020
1 parent 6bcac6c commit 446c745
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions ATL.test/IO/MetaData/ID3v2.cs
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,31 @@ public void TagIO_R_ID3v2_WXXX_UnicodeNoDesc()
Assert.AreEqual("http://remix.evillich.com", theFile.ID3v2.AdditionalFields["WXXX"].Split(Settings.InternalValueSeparator)[1]);
}

[TestMethod]
public void TagIO_R_ID3v2_WXXX_ManualUpdate()
{
string testFileLocation = TestUtils.CopyAsTempTestFile("MP3/id3v2.4_UTF8.mp3");
AudioDataManager theFile = new AudioDataManager(ATL.AudioData.AudioDataIOFactory.GetInstance().GetFromPath(testFileLocation));

TagData theTag = new TagData();
theTag.AdditionalFields = new List<MetaFieldInfo>();
MetaFieldInfo info = new MetaFieldInfo(MetaDataIOFactory.TAG_ID3V2, "WXXX", "http://justtheurl.com");
theTag.AdditionalFields.Add(info);

Assert.IsTrue(theFile.UpdateTagInFile(theTag, tagType));

Assert.IsTrue(theFile.ReadFromFile(false, true));

Assert.IsNotNull(theFile.getMeta(tagType));
IMetaDataIO meta = theFile.getMeta(tagType);
Assert.IsTrue(meta.Exists);

Assert.IsTrue(meta.AdditionalFields.ContainsKey("WXXX"));
Assert.AreEqual("http://justtheurl.com", meta.AdditionalFields["WXXX"].Split(Settings.InternalValueSeparator)[1]);

File.Delete(testFileLocation);
}

[TestMethod]
public void TagIO_RW_ID3v24_Extended()
{
Expand Down

0 comments on commit 446c745

Please sign in to comment.