aboutsummaryrefslogtreecommitdiff
path: root/tests/Jellyfin.Extensions.Tests/StringExtensionsTests.cs
diff options
context:
space:
mode:
authorClaus Vium <cvium@users.noreply.github.com>2021-06-22 07:38:08 +0200
committerGitHub <noreply@github.com>2021-06-22 07:38:08 +0200
commitf50bdb0f328e0c853f97521b12c3618b1af55e0b (patch)
treeec7eb27175c1a00a2f6199a012d69c152a082c3c /tests/Jellyfin.Extensions.Tests/StringExtensionsTests.cs
parent026d8d28b7e7e0aea54426eff05419e2bfc735a0 (diff)
parentdb716bde95e6c14afc48d1343fc74ddbbd2ad97e (diff)
Merge pull request #6204 from Bond-009/extensions
Diffstat (limited to 'tests/Jellyfin.Extensions.Tests/StringExtensionsTests.cs')
-rw-r--r--tests/Jellyfin.Extensions.Tests/StringExtensionsTests.cs18
1 files changed, 18 insertions, 0 deletions
diff --git a/tests/Jellyfin.Extensions.Tests/StringExtensionsTests.cs b/tests/Jellyfin.Extensions.Tests/StringExtensionsTests.cs
new file mode 100644
index 000000000..d1aa2e476
--- /dev/null
+++ b/tests/Jellyfin.Extensions.Tests/StringExtensionsTests.cs
@@ -0,0 +1,18 @@
+using System;
+using Xunit;
+
+namespace Jellyfin.Extensions.Tests
+{
+ public class StringExtensionsTests
+ {
+ [Theory]
+ [InlineData("", '_', 0)]
+ [InlineData("___", '_', 3)]
+ [InlineData("test\x00", '\x00', 1)]
+ [InlineData("Imdb=tt0119567|Tmdb=330|TmdbCollection=328", '|', 2)]
+ public void ReadOnlySpan_Count_Success(string str, char needle, int count)
+ {
+ Assert.Equal(count, str.AsSpan().Count(needle));
+ }
+ }
+}