diff options
| author | Claus Vium <cvium@users.noreply.github.com> | 2021-06-12 08:08:46 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-06-12 08:08:46 +0200 |
| commit | 93dbbfea03612e5b0321c31b80207a00a1691619 (patch) | |
| tree | 8d56442d90817747842d8dd0c6f709dbc04f96d5 /tests/Jellyfin.Controller.Tests/Extensions/StringExtensionsTests.cs | |
| parent | 83e492b72bbb7ac685be17ac546af30a62dbb7f5 (diff) | |
| parent | 5fb72951a0cccc27fb324e555735dc48b3b2beca (diff) | |
Merge pull request #6173 from Bond-009/tests5
Add test for ReadOnlySpan.Count extension
Diffstat (limited to 'tests/Jellyfin.Controller.Tests/Extensions/StringExtensionsTests.cs')
| -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)); + } + } +} |
