aboutsummaryrefslogtreecommitdiff
path: root/tests/Jellyfin.Server.Implementations.Tests/Library/PathExtensionsTests.cs
diff options
context:
space:
mode:
authorBond_009 <bond.009@outlook.com>2020-04-19 15:18:28 +0200
committerBond_009 <bond.009@outlook.com>2020-04-20 10:18:12 +0200
commit7f4a229cd2fee89fdd8329c9c9f907e381d45c46 (patch)
treece60fe469b635c7c3369964d9783affebc483639 /tests/Jellyfin.Server.Implementations.Tests/Library/PathExtensionsTests.cs
parent3142c9b9901cc653eb758ba7d47edbbe2190f83d (diff)
Add some simple tests
Diffstat (limited to 'tests/Jellyfin.Server.Implementations.Tests/Library/PathExtensionsTests.cs')
-rw-r--r--tests/Jellyfin.Server.Implementations.Tests/Library/PathExtensionsTests.cs17
1 files changed, 17 insertions, 0 deletions
diff --git a/tests/Jellyfin.Server.Implementations.Tests/Library/PathExtensionsTests.cs b/tests/Jellyfin.Server.Implementations.Tests/Library/PathExtensionsTests.cs
new file mode 100644
index 000000000..7053ed329
--- /dev/null
+++ b/tests/Jellyfin.Server.Implementations.Tests/Library/PathExtensionsTests.cs
@@ -0,0 +1,17 @@
+using Emby.Server.Implementations.Library;
+using Xunit;
+
+namespace Jellyfin.Server.Implementations.Tests.Library
+{
+ public class PathExtensionsTests
+ {
+ [Theory]
+ [InlineData("Superman: Red Son [imdbid=tt10985510]", "imdbid", "tt10985510")]
+ [InlineData("Superman: Red Son - tt10985510", "imdbid", "tt10985510")]
+ [InlineData("Superman: Red Son", "imdbid", null)]
+ public void GetAttributeValueTest(string input, string attribute, string? result)
+ {
+ Assert.Equal(result, PathExtensions.GetAttributeValue(input, attribute));
+ }
+ }
+}