Skip to content

Commit

Permalink
add meta extra test
Browse files Browse the repository at this point in the history
  • Loading branch information
mfkl committed Jun 5, 2024
1 parent 4c8e262 commit 6121e17
Showing 1 changed file with 21 additions and 1 deletion.
22 changes: 21 additions & 1 deletion src/LibVLCSharp.Tests/EventManagerTests.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using System;
using System.IO;
using System.Linq;
using System.Threading.Tasks;
using LibVLCSharp;
using NUnit.Framework;
Expand All @@ -11,7 +12,7 @@ public class EventManagerTests : BaseSetup
{
[Test]
[Ignore("event does not fire in unit test")]
public async Task MetaChangedEventSubscribe()
public void MetaChangedEventSubscribe()
{
var media = new Media(Path.GetTempFileName());
var eventHandlerCalled = false;
Expand Down Expand Up @@ -42,5 +43,24 @@ public async void DurationChanged()
Assert.True(called);
Assert.NotZero(duration);
}

[Test]
public void MetaExtraTest()
{
var key = "key";
var value = "value";

var media = new Media(LocalAudioFile);

media.SetMetaExtra(key, value);

Assert.AreEqual(value, media.MetaExtra(key));
Assert.AreEqual(key, media.MetaExtraNames.Single());

media.SetMetaExtra(key, null);

Assert.AreEqual(null, media.MetaExtra(key));
Assert.IsEmpty(media.MetaExtraNames);
}
}
}

0 comments on commit 6121e17

Please sign in to comment.