aboutsummaryrefslogtreecommitdiff
path: root/tests/Jellyfin.Model.Tests
diff options
context:
space:
mode:
authorShadowghost <Ghost_of_Stone@web.de>2024-09-17 23:34:12 +0200
committerShadowghost <Ghost_of_Stone@web.de>2024-09-17 23:34:12 +0200
commit5a5da33f44b933215c95947c479ded1cdbadbcd9 (patch)
tree5e95194c6ccb689f9fbaf44922675cc93dab6ece /tests/Jellyfin.Model.Tests
parent2351eeba561905bafae48a948f3126797c284766 (diff)
Apply review suggestions
Diffstat (limited to 'tests/Jellyfin.Model.Tests')
-rw-r--r--tests/Jellyfin.Model.Tests/Dlna/ContainerHelperTests.cs29
1 files changed, 29 insertions, 0 deletions
diff --git a/tests/Jellyfin.Model.Tests/Dlna/ContainerHelperTests.cs b/tests/Jellyfin.Model.Tests/Dlna/ContainerHelperTests.cs
index 68f8d94c7..1ad4bed56 100644
--- a/tests/Jellyfin.Model.Tests/Dlna/ContainerHelperTests.cs
+++ b/tests/Jellyfin.Model.Tests/Dlna/ContainerHelperTests.cs
@@ -40,6 +40,11 @@ public class ContainerHelperTests
public void ContainsContainer_NotInList_ReturnsFalse(string container, string? extension)
{
Assert.False(ContainerHelper.ContainsContainer(container, extension));
+
+ if (extension is not null)
+ {
+ Assert.False(ContainerHelper.ContainsContainer(container, extension.AsSpan()));
+ }
}
[Theory]
@@ -51,4 +56,28 @@ public class ContainerHelperTests
{
Assert.True(ContainerHelper.ContainsContainer(container, extension.AsSpan()));
}
+
+ [Theory]
+ [InlineData(new string[] { "mp3", "mpeg" }, false, "mpeg")]
+ [InlineData(new string[] { "mp3", "mpeg", "avi" }, false, "avi")]
+ [InlineData(new string[] { "mp3", "", "avi" }, false, "mp3")]
+ [InlineData(new string[] { "mp3", "mpeg" }, true, "avi")]
+ [InlineData(new string[] { "mp3", "mpeg", "avi" }, true, "mkv")]
+ [InlineData(new string[] { "mp3", "", "avi" }, true, "")]
+ public void ContainsContainer_ThreeArgs_InList_ReturnsTrue(string[] containers, bool isNegativeList, string inputContainer)
+ {
+ Assert.True(ContainerHelper.ContainsContainer(containers, isNegativeList, inputContainer));
+ }
+
+ [Theory]
+ [InlineData(new string[] { "mp3", "mpeg" }, false, "avi")]
+ [InlineData(new string[] { "mp3", "mpeg", "avi" }, false, "mkv")]
+ [InlineData(new string[] { "mp3", "", "avi" }, false, "")]
+ [InlineData(new string[] { "mp3", "mpeg" }, true, "mpeg")]
+ [InlineData(new string[] { "mp3", "mpeg", "avi" }, true, "mp3")]
+ [InlineData(new string[] { "mp3", "", "avi" }, true, "avi")]
+ public void ContainsContainer_ThreeArgs_InList_ReturnsFalse(string[] containers, bool isNegativeList, string inputContainer)
+ {
+ Assert.False(ContainerHelper.ContainsContainer(containers, isNegativeList, inputContainer));
+ }
}