aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorBond-009 <bond.009@outlook.com>2025-04-01 01:38:25 +0200
committerGitHub <noreply@github.com>2025-03-31 17:38:25 -0600
commite9729a536f26a92ccd30cfff4e698e66dbda1adc (patch)
tree1490275722e18c8cfc5d47d072af1189f021638e /tests
parent3fc3b04daf929d1d3a9533fc410cb77885eb2e8a (diff)
Use pattern matching for null checks (#13793)
Fix the few that slipped through
Diffstat (limited to 'tests')
-rw-r--r--tests/Jellyfin.Api.Tests/Controllers/UserControllerTests.cs4
-rw-r--r--tests/Jellyfin.Model.Tests/Dlna/StreamInfoTests.cs4
2 files changed, 4 insertions, 4 deletions
diff --git a/tests/Jellyfin.Api.Tests/Controllers/UserControllerTests.cs b/tests/Jellyfin.Api.Tests/Controllers/UserControllerTests.cs
index a74dab5f2..e95df1635 100644
--- a/tests/Jellyfin.Api.Tests/Controllers/UserControllerTests.cs
+++ b/tests/Jellyfin.Api.Tests/Controllers/UserControllerTests.cs
@@ -87,7 +87,7 @@ public class UserControllerTests
Assert.Contains(
Validate(userPolicy), v =>
v.MemberNames.Contains("PasswordResetProviderId") &&
- v.ErrorMessage != null &&
+ v.ErrorMessage is not null &&
v.ErrorMessage.Contains("required", StringComparison.CurrentCultureIgnoreCase));
}
@@ -105,7 +105,7 @@ public class UserControllerTests
Assert.Contains(Validate(userPolicy), v =>
v.MemberNames.Contains("AuthenticationProviderId") &&
- v.ErrorMessage != null &&
+ v.ErrorMessage is not null &&
v.ErrorMessage.Contains("required", StringComparison.CurrentCultureIgnoreCase));
}
diff --git a/tests/Jellyfin.Model.Tests/Dlna/StreamInfoTests.cs b/tests/Jellyfin.Model.Tests/Dlna/StreamInfoTests.cs
index 86819de8c..8dea46806 100644
--- a/tests/Jellyfin.Model.Tests/Dlna/StreamInfoTests.cs
+++ b/tests/Jellyfin.Model.Tests/Dlna/StreamInfoTests.cs
@@ -31,7 +31,7 @@ public class StreamInfoTests
/// <returns>An <see cref="Array"/> of <see cref="Type"/>.</returns>
private static object? RandomArray(Random random, Type? elementType)
{
- if (elementType == null)
+ if (elementType is null)
{
return null;
}
@@ -148,7 +148,7 @@ public class StreamInfoTests
var type = property.PropertyType;
// If nullable, then set it to null, 25% of the time.
- if (Nullable.GetUnderlyingType(type) != null)
+ if (Nullable.GetUnderlyingType(type) is not null)
{
if (random.Next(0, 4) == 0)
{