diff options
| author | Bond_009 <bond.009@outlook.com> | 2021-06-12 00:56:09 +0200 |
|---|---|---|
| committer | Bond_009 <bond.009@outlook.com> | 2021-06-12 00:56:09 +0200 |
| commit | 5fb72951a0cccc27fb324e555735dc48b3b2beca (patch) | |
| tree | 798355ac9189973ef7e8da7723361f99ad5bb6d2 /tests/Jellyfin.Controller.Tests | |
| parent | cfad97ff28339088ab86c40661bb407024285a7c (diff) | |
Add test for ReadOnlySpan.Count extension
Diffstat (limited to 'tests/Jellyfin.Controller.Tests')
| -rw-r--r-- | tests/Jellyfin.Controller.Tests/Extensions/StringExtensionsTests.cs | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/tests/Jellyfin.Controller.Tests/Extensions/StringExtensionsTests.cs b/tests/Jellyfin.Controller.Tests/Extensions/StringExtensionsTests.cs new file mode 100644 index 000000000..576c0a49b --- /dev/null +++ b/tests/Jellyfin.Controller.Tests/Extensions/StringExtensionsTests.cs @@ -0,0 +1,19 @@ +using System; +using MediaBrowser.Controller.Extensions; +using Xunit; + +namespace Jellyfin.Controller.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)); + } + } +} |
