Skip to content

Instantly share code, notes, and snippets.

@PatrickKalkman
Last active February 1, 2019 13:28
Show Gist options
  • Save PatrickKalkman/b553898a9c3d5b098f556bc427846d74 to your computer and use it in GitHub Desktop.
Save PatrickKalkman/b553898a9c3d5b098f556bc427846d74 to your computer and use it in GitHub Desktop.
Test for testing parsing multiple Tag attributes
[Test]
public void MultipleTagAttributesAreParsed()
{
var input = @"TYPE=AUDIO,GROUP-ID=""audio"",NAME=""audio"",DEFAULT=YES";
List<PlaylistTagAttribute> tagAttributes =
PlaylistGrammar.MultipleTagAttributesParser.Parse(input);
Assert.That(tagAttributes.Count, Is.EqualTo(4));
Assert.AreEqual("TYPE", tagAttributes[0].Key);
Assert.AreEqual("AUDIO", tagAttributes[0].Value);
Assert.AreEqual("GROUP-ID", tagAttributes[1].Key);
Assert.AreEqual("audio", tagAttributes[1].Value);
Assert.AreEqual("NAME", tagAttributes[2].Key);
Assert.AreEqual("audio", tagAttributes[2].Value);
Assert.AreEqual("DEFAULT", tagAttributes[3].Key);
Assert.AreEqual("YES", tagAttributes[3].Value);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment