aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/Jellyfin.Server.Implementations.Tests/Localization/LocalizationManagerTests.cs5
-rw-r--r--tests/Jellyfin.Server.Implementations.Tests/Users/UserManagerTests.cs4
2 files changed, 8 insertions, 1 deletions
diff --git a/tests/Jellyfin.Server.Implementations.Tests/Localization/LocalizationManagerTests.cs b/tests/Jellyfin.Server.Implementations.Tests/Localization/LocalizationManagerTests.cs
index 65f018ee3..cc67dbc39 100644
--- a/tests/Jellyfin.Server.Implementations.Tests/Localization/LocalizationManagerTests.cs
+++ b/tests/Jellyfin.Server.Implementations.Tests/Localization/LocalizationManagerTests.cs
@@ -1,6 +1,5 @@
using System;
using System.Linq;
-using System.Runtime.InteropServices;
using System.Threading.Tasks;
using Emby.Server.Implementations.Localization;
using MediaBrowser.Controller.Configuration;
@@ -116,6 +115,10 @@ namespace Jellyfin.Server.Implementations.Tests.Localization
[InlineData("TV-MA", "US", 17)]
[InlineData("XXX", "asdf", 1000)]
[InlineData("Germany: FSK-18", "DE", 18)]
+ [InlineData("Rated : R", "US", 17)]
+ [InlineData("Rated: R", "US", 17)]
+ [InlineData("Rated R", "US", 17)]
+ [InlineData(" PG-13 ", "US", 13)]
public async Task GetRatingLevel_GivenValidString_Success(string value, string countryCode, int expectedLevel)
{
var localizationManager = Setup(new ServerConfiguration()
diff --git a/tests/Jellyfin.Server.Implementations.Tests/Users/UserManagerTests.cs b/tests/Jellyfin.Server.Implementations.Tests/Users/UserManagerTests.cs
index 665afe111..4cea53bd3 100644
--- a/tests/Jellyfin.Server.Implementations.Tests/Users/UserManagerTests.cs
+++ b/tests/Jellyfin.Server.Implementations.Tests/Users/UserManagerTests.cs
@@ -23,6 +23,10 @@ namespace Jellyfin.Server.Implementations.Tests.Users
[InlineData(" ")]
[InlineData("")]
[InlineData("special characters like & $ ? are not allowed")]
+ [InlineData("thishasaspaceontheend ")]
+ [InlineData(" thishasaspaceatthestart")]
+ [InlineData(" thishasaspaceatbothends ")]
+ [InlineData(" this has a space at both ends and inbetween ")]
public void ThrowIfInvalidUsername_WhenInvalidUsername_ThrowsArgumentException(string username)
{
Assert.Throws<ArgumentException>(() => UserManager.ThrowIfInvalidUsername(username));