diff options
| author | Shadowghost <Ghost_of_Stone@web.de> | 2022-12-07 17:40:24 +0100 |
|---|---|---|
| committer | Shadowghost <Ghost_of_Stone@web.de> | 2022-12-07 17:40:24 +0100 |
| commit | 2c86bd1875e6e85d5867618e992d850453dae663 (patch) | |
| tree | 671070fb246fd3821bf6f1e58a01c402a2f969d1 /tests | |
| parent | dd5f90802e71083347b6095eb79a9de0b9d34615 (diff) | |
| parent | 3cb7fe50127b1a8158186b390836ee25ae5a50fd (diff) | |
Merge branch 'master' into network-rewrite
Diffstat (limited to 'tests')
28 files changed, 63 insertions, 64 deletions
diff --git a/tests/Jellyfin.Api.Tests/Jellyfin.Api.Tests.csproj b/tests/Jellyfin.Api.Tests/Jellyfin.Api.Tests.csproj index a20c9690f..bd412bc76 100644 --- a/tests/Jellyfin.Api.Tests/Jellyfin.Api.Tests.csproj +++ b/tests/Jellyfin.Api.Tests/Jellyfin.Api.Tests.csproj @@ -6,7 +6,7 @@ </PropertyGroup> <PropertyGroup> - <TargetFramework>net6.0</TargetFramework> + <TargetFramework>net7.0</TargetFramework> <IsPackable>false</IsPackable> <CodeAnalysisRuleSet>../jellyfin-tests.ruleset</CodeAnalysisRuleSet> </PropertyGroup> @@ -15,8 +15,8 @@ <PackageReference Include="AutoFixture" Version="4.17.0" /> <PackageReference Include="AutoFixture.AutoMoq" Version="4.17.0" /> <PackageReference Include="AutoFixture.Xunit2" Version="4.17.0" /> - <PackageReference Include="Microsoft.AspNetCore.Mvc.Testing" Version="6.0.9" /> - <PackageReference Include="Microsoft.Extensions.Options" Version="6.0.0" /> + <PackageReference Include="Microsoft.AspNetCore.Mvc.Testing" Version="7.0.0" /> + <PackageReference Include="Microsoft.Extensions.Options" Version="7.0.0" /> <PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.3.2" /> <PackageReference Include="xunit" Version="2.4.2" /> <PackageReference Include="xunit.runner.visualstudio" Version="2.4.5"> diff --git a/tests/Jellyfin.Api.Tests/TestHelpers.cs b/tests/Jellyfin.Api.Tests/TestHelpers.cs index f9bca4146..5eab3ae6f 100644 --- a/tests/Jellyfin.Api.Tests/TestHelpers.cs +++ b/tests/Jellyfin.Api.Tests/TestHelpers.cs @@ -36,7 +36,7 @@ namespace Jellyfin.Api.Tests user.SetPermission(PermissionKind.IsAdministrator, role.Equals(UserRoles.Administrator, StringComparison.OrdinalIgnoreCase)); // Add access schedules if set. - if (accessSchedules != null) + if (accessSchedules is not null) { foreach (var accessSchedule in accessSchedules) { diff --git a/tests/Jellyfin.Common.Tests/Jellyfin.Common.Tests.csproj b/tests/Jellyfin.Common.Tests/Jellyfin.Common.Tests.csproj index 95fc1d917..3ca761b3d 100644 --- a/tests/Jellyfin.Common.Tests/Jellyfin.Common.Tests.csproj +++ b/tests/Jellyfin.Common.Tests/Jellyfin.Common.Tests.csproj @@ -6,7 +6,7 @@ </PropertyGroup> <PropertyGroup> - <TargetFramework>net6.0</TargetFramework> + <TargetFramework>net7.0</TargetFramework> <IsPackable>false</IsPackable> <CodeAnalysisRuleSet>../jellyfin-tests.ruleset</CodeAnalysisRuleSet> </PropertyGroup> diff --git a/tests/Jellyfin.Controller.Tests/Entities/BaseItemTests.cs b/tests/Jellyfin.Controller.Tests/Entities/BaseItemTests.cs index 985bbcde1..f3ada59db 100644 --- a/tests/Jellyfin.Controller.Tests/Entities/BaseItemTests.cs +++ b/tests/Jellyfin.Controller.Tests/Entities/BaseItemTests.cs @@ -1,18 +1,17 @@ using MediaBrowser.Controller.Entities; using Xunit; -namespace Jellyfin.Controller.Tests.Entities +namespace Jellyfin.Controller.Tests.Entities; + +public class BaseItemTests { - public class BaseItemTests - { - [Theory] - [InlineData("", "")] - [InlineData("1", "0000000001")] - [InlineData("t", "t")] - [InlineData("test", "test")] - [InlineData("test1", "test0000000001")] - [InlineData("1test 2", "0000000001test 0000000002")] - public void BaseItem_ModifySortChunks_Valid(string input, string expected) - => Assert.Equal(expected, BaseItem.ModifySortChunks(input)); - } + [Theory] + [InlineData("", "")] + [InlineData("1", "0000000001")] + [InlineData("t", "t")] + [InlineData("test", "test")] + [InlineData("test1", "test0000000001")] + [InlineData("1test 2", "0000000001test 0000000002")] + public void BaseItem_ModifySortChunks_Valid(string input, string expected) + => Assert.Equal(expected, BaseItem.ModifySortChunks(input)); } diff --git a/tests/Jellyfin.Controller.Tests/Jellyfin.Controller.Tests.csproj b/tests/Jellyfin.Controller.Tests/Jellyfin.Controller.Tests.csproj index d95747206..650973c6a 100644 --- a/tests/Jellyfin.Controller.Tests/Jellyfin.Controller.Tests.csproj +++ b/tests/Jellyfin.Controller.Tests/Jellyfin.Controller.Tests.csproj @@ -6,7 +6,7 @@ </PropertyGroup> <PropertyGroup> - <TargetFramework>net6.0</TargetFramework> + <TargetFramework>net7.0</TargetFramework> <IsPackable>false</IsPackable> <CodeAnalysisRuleSet>../jellyfin-tests.ruleset</CodeAnalysisRuleSet> </PropertyGroup> diff --git a/tests/Jellyfin.Dlna.Tests/Jellyfin.Dlna.Tests.csproj b/tests/Jellyfin.Dlna.Tests/Jellyfin.Dlna.Tests.csproj index 1444d6faf..cba946800 100644 --- a/tests/Jellyfin.Dlna.Tests/Jellyfin.Dlna.Tests.csproj +++ b/tests/Jellyfin.Dlna.Tests/Jellyfin.Dlna.Tests.csproj @@ -1,7 +1,7 @@ <Project Sdk="Microsoft.NET.Sdk"> <PropertyGroup> - <TargetFramework>net6.0</TargetFramework> + <TargetFramework>net7.0</TargetFramework> <IsPackable>false</IsPackable> <CodeAnalysisRuleSet>../jellyfin-tests.ruleset</CodeAnalysisRuleSet> </PropertyGroup> diff --git a/tests/Jellyfin.Extensions.Tests/Jellyfin.Extensions.Tests.csproj b/tests/Jellyfin.Extensions.Tests/Jellyfin.Extensions.Tests.csproj index 9e3bef881..075bcaac8 100644 --- a/tests/Jellyfin.Extensions.Tests/Jellyfin.Extensions.Tests.csproj +++ b/tests/Jellyfin.Extensions.Tests/Jellyfin.Extensions.Tests.csproj @@ -1,7 +1,7 @@ <Project Sdk="Microsoft.NET.Sdk"> <PropertyGroup> - <TargetFramework>net6.0</TargetFramework> + <TargetFramework>net7.0</TargetFramework> <IsPackable>false</IsPackable> <CodeAnalysisRuleSet>../jellyfin-tests.ruleset</CodeAnalysisRuleSet> </PropertyGroup> diff --git a/tests/Jellyfin.MediaEncoding.Hls.Tests/Jellyfin.MediaEncoding.Hls.Tests.csproj b/tests/Jellyfin.MediaEncoding.Hls.Tests/Jellyfin.MediaEncoding.Hls.Tests.csproj index 83ea1907c..f7163edc7 100644 --- a/tests/Jellyfin.MediaEncoding.Hls.Tests/Jellyfin.MediaEncoding.Hls.Tests.csproj +++ b/tests/Jellyfin.MediaEncoding.Hls.Tests/Jellyfin.MediaEncoding.Hls.Tests.csproj @@ -1,7 +1,7 @@ <Project Sdk="Microsoft.NET.Sdk"> <PropertyGroup> - <TargetFramework>net6.0</TargetFramework> + <TargetFramework>net7.0</TargetFramework> <IsPackable>false</IsPackable> <CodeAnalysisRuleSet>../jellyfin-tests.ruleset</CodeAnalysisRuleSet> </PropertyGroup> diff --git a/tests/Jellyfin.MediaEncoding.Keyframes.Tests/Jellyfin.MediaEncoding.Keyframes.Tests.csproj b/tests/Jellyfin.MediaEncoding.Keyframes.Tests/Jellyfin.MediaEncoding.Keyframes.Tests.csproj index 84a069424..72bfb3fd2 100644 --- a/tests/Jellyfin.MediaEncoding.Keyframes.Tests/Jellyfin.MediaEncoding.Keyframes.Tests.csproj +++ b/tests/Jellyfin.MediaEncoding.Keyframes.Tests/Jellyfin.MediaEncoding.Keyframes.Tests.csproj @@ -1,7 +1,7 @@ <Project Sdk="Microsoft.NET.Sdk"> <PropertyGroup> - <TargetFramework>net6.0</TargetFramework> + <TargetFramework>net7.0</TargetFramework> <IsPackable>false</IsPackable> <CodeAnalysisRuleSet>../jellyfin-tests.ruleset</CodeAnalysisRuleSet> <RootNamespace>Jellyfin.MediaEncoding.Keyframes</RootNamespace> diff --git a/tests/Jellyfin.MediaEncoding.Tests/Jellyfin.MediaEncoding.Tests.csproj b/tests/Jellyfin.MediaEncoding.Tests/Jellyfin.MediaEncoding.Tests.csproj index 4cff2143c..e68e7f39a 100644 --- a/tests/Jellyfin.MediaEncoding.Tests/Jellyfin.MediaEncoding.Tests.csproj +++ b/tests/Jellyfin.MediaEncoding.Tests/Jellyfin.MediaEncoding.Tests.csproj @@ -6,7 +6,7 @@ </PropertyGroup> <PropertyGroup> - <TargetFramework>net6.0</TargetFramework> + <TargetFramework>net7.0</TargetFramework> <IsPackable>false</IsPackable> <CodeAnalysisRuleSet>../jellyfin-tests.ruleset</CodeAnalysisRuleSet> </PropertyGroup> diff --git a/tests/Jellyfin.Model.Tests/Dlna/StreamBuilderTests.cs b/tests/Jellyfin.Model.Tests/Dlna/StreamBuilderTests.cs index e1bd2fe0f..5e11a7232 100644 --- a/tests/Jellyfin.Model.Tests/Dlna/StreamBuilderTests.cs +++ b/tests/Jellyfin.Model.Tests/Dlna/StreamBuilderTests.cs @@ -323,7 +323,7 @@ namespace Jellyfin.Model.Tests var val = builder.BuildVideoItem(options); Assert.NotNull(val); - if (playMethod != null) + if (playMethod is not null) { Assert.Equal(playMethod, val.PlayMethod); } @@ -472,7 +472,7 @@ namespace Jellyfin.Model.Tests } } } - else if (playMethod == null) + else if (playMethod is null) { Assert.Null(val.SubProtocol); Assert.Equal("stream", uri.Filename); @@ -490,7 +490,7 @@ namespace Jellyfin.Model.Tests using (var stream = File.OpenRead(path)) { var value = await JsonSerializer.DeserializeAsync<T>(stream, JsonDefaults.Options); - if (value != null) + if (value is not null) { return value; } diff --git a/tests/Jellyfin.Model.Tests/Jellyfin.Model.Tests.csproj b/tests/Jellyfin.Model.Tests/Jellyfin.Model.Tests.csproj index fbcaa66f4..2c7e393af 100644 --- a/tests/Jellyfin.Model.Tests/Jellyfin.Model.Tests.csproj +++ b/tests/Jellyfin.Model.Tests/Jellyfin.Model.Tests.csproj @@ -1,7 +1,7 @@ <Project Sdk="Microsoft.NET.Sdk"> <PropertyGroup> - <TargetFramework>net6.0</TargetFramework> + <TargetFramework>net7.0</TargetFramework> <IsPackable>false</IsPackable> <CodeAnalysisRuleSet>../jellyfin-tests.ruleset</CodeAnalysisRuleSet> </PropertyGroup> diff --git a/tests/Jellyfin.Naming.Tests/Jellyfin.Naming.Tests.csproj b/tests/Jellyfin.Naming.Tests/Jellyfin.Naming.Tests.csproj index da0e9f5b1..0d9acf0e1 100644 --- a/tests/Jellyfin.Naming.Tests/Jellyfin.Naming.Tests.csproj +++ b/tests/Jellyfin.Naming.Tests/Jellyfin.Naming.Tests.csproj @@ -6,7 +6,7 @@ </PropertyGroup> <PropertyGroup> - <TargetFramework>net6.0</TargetFramework> + <TargetFramework>net7.0</TargetFramework> <IsPackable>false</IsPackable> <CodeAnalysisRuleSet>../jellyfin-tests.ruleset</CodeAnalysisRuleSet> </PropertyGroup> diff --git a/tests/Jellyfin.Naming.Tests/TV/SeasonFolderTests.cs b/tests/Jellyfin.Naming.Tests/TV/SeasonFolderTests.cs index b7b5b54ec..55af33836 100644 --- a/tests/Jellyfin.Naming.Tests/TV/SeasonFolderTests.cs +++ b/tests/Jellyfin.Naming.Tests/TV/SeasonFolderTests.cs @@ -27,7 +27,7 @@ namespace Jellyfin.Naming.Tests.TV { var result = SeasonPathParser.Parse(path, true, true); - Assert.Equal(result.SeasonNumber != null, result.Success); + Assert.Equal(result.SeasonNumber is not null, result.Success); Assert.Equal(result.SeasonNumber, seasonNumber); Assert.Equal(isSeasonDirectory, result.IsSeasonFolder); } diff --git a/tests/Jellyfin.Naming.Tests/Video/Format3DTests.cs b/tests/Jellyfin.Naming.Tests/Video/Format3DTests.cs index 1762b91b9..511a014a6 100644 --- a/tests/Jellyfin.Naming.Tests/Video/Format3DTests.cs +++ b/tests/Jellyfin.Naming.Tests/Video/Format3DTests.cs @@ -61,7 +61,7 @@ namespace Jellyfin.Naming.Tests.Video Assert.Equal(is3D, result.Is3D); - if (format3D == null) + if (format3D is null) { Assert.Null(result?.Format3D); } diff --git a/tests/Jellyfin.Naming.Tests/Video/MultiVersionTests.cs b/tests/Jellyfin.Naming.Tests/Video/MultiVersionTests.cs index 79f2366b8..287d881a8 100644 --- a/tests/Jellyfin.Naming.Tests/Video/MultiVersionTests.cs +++ b/tests/Jellyfin.Naming.Tests/Video/MultiVersionTests.cs @@ -25,8 +25,8 @@ namespace Jellyfin.Naming.Tests.Video files.Select(i => VideoResolver.Resolve(i, false, _namingOptions)).OfType<VideoFileInfo>().ToList(), _namingOptions).ToList(); - Assert.Single(result.Where(v => v.ExtraType == null)); - Assert.Single(result.Where(v => v.ExtraType != null)); + Assert.Single(result.Where(v => v.ExtraType is null)); + Assert.Single(result.Where(v => v.ExtraType is not null)); } [Fact] @@ -44,8 +44,8 @@ namespace Jellyfin.Naming.Tests.Video files.Select(i => VideoResolver.Resolve(i, false, _namingOptions)).OfType<VideoFileInfo>().ToList(), _namingOptions).ToList(); - Assert.Single(result.Where(v => v.ExtraType == null)); - Assert.Single(result.Where(v => v.ExtraType != null)); + Assert.Single(result.Where(v => v.ExtraType is null)); + Assert.Single(result.Where(v => v.ExtraType is not null)); Assert.Equal(2, result[0].AlternateVersions.Count); } diff --git a/tests/Jellyfin.Networking.Tests/Jellyfin.Networking.Tests.csproj b/tests/Jellyfin.Networking.Tests/Jellyfin.Networking.Tests.csproj index 8ec0262bd..9e13dd4ad 100644 --- a/tests/Jellyfin.Networking.Tests/Jellyfin.Networking.Tests.csproj +++ b/tests/Jellyfin.Networking.Tests/Jellyfin.Networking.Tests.csproj @@ -6,7 +6,7 @@ </PropertyGroup> <PropertyGroup> - <TargetFramework>net6.0</TargetFramework> + <TargetFramework>net7.0</TargetFramework> <IsPackable>false</IsPackable> <CodeAnalysisRuleSet>../jellyfin-tests.ruleset</CodeAnalysisRuleSet> </PropertyGroup> diff --git a/tests/Jellyfin.Providers.Tests/Jellyfin.Providers.Tests.csproj b/tests/Jellyfin.Providers.Tests/Jellyfin.Providers.Tests.csproj index 194229737..2d8e3c8f2 100644 --- a/tests/Jellyfin.Providers.Tests/Jellyfin.Providers.Tests.csproj +++ b/tests/Jellyfin.Providers.Tests/Jellyfin.Providers.Tests.csproj @@ -1,7 +1,7 @@ <Project Sdk="Microsoft.NET.Sdk"> <PropertyGroup> - <TargetFramework>net6.0</TargetFramework> + <TargetFramework>net7.0</TargetFramework> <IsPackable>false</IsPackable> <CodeAnalysisRuleSet>../jellyfin-tests.ruleset</CodeAnalysisRuleSet> </PropertyGroup> diff --git a/tests/Jellyfin.Providers.Tests/Manager/MetadataServiceTests.cs b/tests/Jellyfin.Providers.Tests/Manager/MetadataServiceTests.cs index 28b2e1d8f..e18faa422 100644 --- a/tests/Jellyfin.Providers.Tests/Manager/MetadataServiceTests.cs +++ b/tests/Jellyfin.Providers.Tests/Manager/MetadataServiceTests.cs @@ -91,7 +91,7 @@ namespace Jellyfin.Providers.Tests.Manager // Use type Series to hit DisplayOrder Assert.False(TestMergeBaseItemData<Series, SeriesInfo>(propName, oldValue, newValue, null, false, out _)); - if (lockField != null) + if (lockField is not null) { Assert.False(TestMergeBaseItemData<Series, SeriesInfo>(propName, oldValue, newValue, lockField, true, out _)); Assert.False(TestMergeBaseItemData<Series, SeriesInfo>(propName, null, newValue, lockField, false, out _)); @@ -120,7 +120,7 @@ namespace Jellyfin.Providers.Tests.Manager // Use type Audio to hit AlbumArtists Assert.False(TestMergeBaseItemData<Audio, SongInfo>(propName, oldValue, newValue, null, false, out _)); - if (lockField != null) + if (lockField is not null) { Assert.False(TestMergeBaseItemData<Audio, SongInfo>(propName, oldValue, newValue, lockField, true, out _)); Assert.False(TestMergeBaseItemData<Audio, SongInfo>(propName, Array.Empty<string>(), newValue, lockField, false, out _)); @@ -328,11 +328,11 @@ namespace Jellyfin.Providers.Tests.Manager People = oldValue }; - var lockedFields = lockField == null ? Array.Empty<MetadataField>() : new[] { (MetadataField)lockField }; + var lockedFields = lockField is null ? Array.Empty<MetadataField>() : new[] { (MetadataField)lockField }; MetadataService<Movie, MovieInfo>.MergeBaseItemData(source, target, lockedFields, replaceData, false); actualValue = target.People; - return newValue?.Equals(actualValue) ?? actualValue == null; + return newValue?.Equals(actualValue) ?? actualValue is null; } /// <summary> @@ -367,12 +367,12 @@ namespace Jellyfin.Providers.Tests.Manager }; property.SetValue(target.Item, oldValue); - var lockedFields = lockField == null ? Array.Empty<MetadataField>() : new[] { (MetadataField)lockField }; + var lockedFields = lockField is null ? Array.Empty<MetadataField>() : new[] { (MetadataField)lockField }; // generic type doesn't actually matter to call the static method, just has to be filled in MetadataService<TItemType, TIdType>.MergeBaseItemData(source, target, lockedFields, replaceData, false); actualValue = property.GetValue(target.Item); - return newValue?.Equals(actualValue) ?? actualValue == null; + return newValue?.Equals(actualValue) ?? actualValue is null; } } } diff --git a/tests/Jellyfin.Providers.Tests/Manager/ProviderManagerTests.cs b/tests/Jellyfin.Providers.Tests/Manager/ProviderManagerTests.cs index 725e295b9..5ca59f0ed 100644 --- a/tests/Jellyfin.Providers.Tests/Manager/ProviderManagerTests.cs +++ b/tests/Jellyfin.Providers.Tests/Manager/ProviderManagerTests.cs @@ -423,14 +423,14 @@ namespace Jellyfin.Providers.Tests.Manager where TProviderType : class, IImageProvider { Mock<IHasOrder>? hasOrder = null; - if (order != null) + if (order is not null) { hasOrder = new Mock<IHasOrder>(MockBehavior.Strict); hasOrder.Setup(i => i.Order) .Returns((int)order); } - var provider = hasOrder == null + var provider = hasOrder is null ? new Mock<TProviderType>(MockBehavior.Strict) : hasOrder.As<TProviderType>(); provider.Setup(p => p.Name) @@ -471,14 +471,14 @@ namespace Jellyfin.Providers.Tests.Manager } Mock<IHasOrder>? hasOrder = null; - if (order != null) + if (order is not null) { - hasOrder = forcedProvider == null ? new Mock<IHasOrder>() : forcedProvider.As<IHasOrder>(); + hasOrder = forcedProvider is null ? new Mock<IHasOrder>() : forcedProvider.As<IHasOrder>(); hasOrder.Setup(i => i.Order) .Returns((int)order); } - var provider = hasOrder == null + var provider = hasOrder is null ? new Mock<TProviderType>(MockBehavior.Strict) : hasOrder.As<TProviderType>(); provider.Setup(p => p.Name) @@ -499,7 +499,7 @@ namespace Jellyfin.Providers.Tests.Manager }; // only create type options if populating it with something - if (imageFetcherOrder != null || metadataFetcherOrder != null) + if (imageFetcherOrder is not null || metadataFetcherOrder is not null) { imageFetcherOrder ??= Array.Empty<string>(); metadataFetcherOrder ??= Array.Empty<string>(); @@ -527,7 +527,7 @@ namespace Jellyfin.Providers.Tests.Manager var serverConfiguration = new ServerConfiguration(); // only create type options if populating it with something - if (imageFetcherOrder != null || localMetadataReaderOrder != null || metadataFetcherOrder != null) + if (imageFetcherOrder is not null || localMetadataReaderOrder is not null || metadataFetcherOrder is not null) { imageFetcherOrder ??= Array.Empty<string>(); localMetadataReaderOrder ??= Array.Empty<string>(); diff --git a/tests/Jellyfin.Providers.Tests/MediaInfo/EmbeddedImageProviderTests.cs b/tests/Jellyfin.Providers.Tests/MediaInfo/EmbeddedImageProviderTests.cs index 9b80f0b94..6b2d9021c 100644 --- a/tests/Jellyfin.Providers.Tests/MediaInfo/EmbeddedImageProviderTests.cs +++ b/tests/Jellyfin.Providers.Tests/MediaInfo/EmbeddedImageProviderTests.cs @@ -80,7 +80,7 @@ namespace Jellyfin.Providers.Tests.MediaInfo var actual = await embeddedImageProvider.GetImage(input, type, CancellationToken.None); Assert.NotNull(actual); - if (expectedFormat == null) + if (expectedFormat is null) { Assert.False(actual.HasImage); } @@ -131,7 +131,7 @@ namespace Jellyfin.Providers.Tests.MediaInfo var actual = await embeddedImageProvider.GetImage(input, type, CancellationToken.None); Assert.NotNull(actual); - if (expectedFormat == null) + if (expectedFormat is null) { Assert.False(actual.HasImage); } diff --git a/tests/Jellyfin.Providers.Tests/MediaInfo/VideoImageProviderTests.cs b/tests/Jellyfin.Providers.Tests/MediaInfo/VideoImageProviderTests.cs index 6b2a05241..7ea6f7d9c 100644 --- a/tests/Jellyfin.Providers.Tests/MediaInfo/VideoImageProviderTests.cs +++ b/tests/Jellyfin.Providers.Tests/MediaInfo/VideoImageProviderTests.cs @@ -110,7 +110,7 @@ namespace Jellyfin.Providers.Tests.MediaInfo private static IMediaSourceManager GetMediaSourceManager(Video item, MediaStream? defaultStream, List<MediaStream> mediaStreams) { var defaultStreamList = new List<MediaStream>(); - if (defaultStream != null) + if (defaultStream is not null) { defaultStreamList.Add(defaultStream); } diff --git a/tests/Jellyfin.Server.Implementations.Tests/Jellyfin.Server.Implementations.Tests.csproj b/tests/Jellyfin.Server.Implementations.Tests/Jellyfin.Server.Implementations.Tests.csproj index 918802d77..d91b4f00b 100644 --- a/tests/Jellyfin.Server.Implementations.Tests/Jellyfin.Server.Implementations.Tests.csproj +++ b/tests/Jellyfin.Server.Implementations.Tests/Jellyfin.Server.Implementations.Tests.csproj @@ -6,7 +6,7 @@ </PropertyGroup> <PropertyGroup> - <TargetFramework>net6.0</TargetFramework> + <TargetFramework>net7.0</TargetFramework> <IsPackable>false</IsPackable> <CodeAnalysisRuleSet>../jellyfin-tests.ruleset</CodeAnalysisRuleSet> <RootNamespace>Jellyfin.Server.Implementations.Tests</RootNamespace> diff --git a/tests/Jellyfin.Server.Implementations.Tests/TypedBaseItem/BaseItemKindTests.cs b/tests/Jellyfin.Server.Implementations.Tests/TypedBaseItem/BaseItemKindTests.cs index 31f33c682..1bd51b246 100644 --- a/tests/Jellyfin.Server.Implementations.Tests/TypedBaseItem/BaseItemKindTests.cs +++ b/tests/Jellyfin.Server.Implementations.Tests/TypedBaseItem/BaseItemKindTests.cs @@ -50,7 +50,7 @@ namespace Jellyfin.Server.Implementations.Tests.TypedBaseItem private static bool IsProjectAssemblyName(string? name) { - if (name == null) + if (name is null) { return false; } diff --git a/tests/Jellyfin.Server.Integration.Tests/Controllers/EncoderController.cs b/tests/Jellyfin.Server.Integration.Tests/Controllers/EncoderController.cs index 1a720c2f6..3d4c27c95 100644 --- a/tests/Jellyfin.Server.Integration.Tests/Controllers/EncoderController.cs +++ b/tests/Jellyfin.Server.Integration.Tests/Controllers/EncoderController.cs @@ -22,7 +22,7 @@ namespace Jellyfin.Server.Integration.Tests.Controllers { return new ContentResult() { - Content = (@params != null && @params.Count > 0) + Content = (@params is not null && @params.Count > 0) ? string.Join("&", @params.Select(x => x.Key + "=" + x.Value)) : string.Empty, ContentType = "text/plain; charset=utf-8", @@ -42,7 +42,7 @@ namespace Jellyfin.Server.Integration.Tests.Controllers { return new ContentResult() { - Content = (@params != null && @params.Count > 0) + Content = (@params is not null && @params.Count > 0) ? string.Join("&", @params.Select(x => x.Key + "=" + string.Join(',', x.Value))) : string.Empty, ContentType = "text/plain; charset=utf-8", diff --git a/tests/Jellyfin.Server.Integration.Tests/Jellyfin.Server.Integration.Tests.csproj b/tests/Jellyfin.Server.Integration.Tests/Jellyfin.Server.Integration.Tests.csproj index 659737392..ecc3ebb86 100644 --- a/tests/Jellyfin.Server.Integration.Tests/Jellyfin.Server.Integration.Tests.csproj +++ b/tests/Jellyfin.Server.Integration.Tests/Jellyfin.Server.Integration.Tests.csproj @@ -1,6 +1,6 @@ <Project Sdk="Microsoft.NET.Sdk"> <PropertyGroup> - <TargetFramework>net6.0</TargetFramework> + <TargetFramework>net7.0</TargetFramework> <IsPackable>false</IsPackable> <CodeAnalysisRuleSet>../jellyfin-tests.ruleset</CodeAnalysisRuleSet> </PropertyGroup> @@ -9,8 +9,8 @@ <PackageReference Include="AutoFixture" Version="4.17.0" /> <PackageReference Include="AutoFixture.AutoMoq" Version="4.17.0" /> <PackageReference Include="AutoFixture.Xunit2" Version="4.17.0" /> - <PackageReference Include="Microsoft.AspNetCore.Mvc.Testing" Version="6.0.9" /> - <PackageReference Include="Microsoft.Extensions.Options" Version="6.0.0" /> + <PackageReference Include="Microsoft.AspNetCore.Mvc.Testing" Version="7.0.0" /> + <PackageReference Include="Microsoft.Extensions.Options" Version="7.0.0" /> <PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.3.2" /> <PackageReference Include="xunit" Version="2.4.2" /> <PackageReference Include="xunit.runner.visualstudio" Version="2.4.5"> diff --git a/tests/Jellyfin.Server.Tests/Jellyfin.Server.Tests.csproj b/tests/Jellyfin.Server.Tests/Jellyfin.Server.Tests.csproj index b2653b28b..0ce2721c7 100644 --- a/tests/Jellyfin.Server.Tests/Jellyfin.Server.Tests.csproj +++ b/tests/Jellyfin.Server.Tests/Jellyfin.Server.Tests.csproj @@ -1,7 +1,7 @@ <Project Sdk="Microsoft.NET.Sdk"> <PropertyGroup> - <TargetFramework>net6.0</TargetFramework> + <TargetFramework>net7.0</TargetFramework> <IsPackable>false</IsPackable> <CodeAnalysisRuleSet>../jellyfin-tests.ruleset</CodeAnalysisRuleSet> </PropertyGroup> @@ -10,8 +10,8 @@ <PackageReference Include="AutoFixture" Version="4.17.0" /> <PackageReference Include="AutoFixture.AutoMoq" Version="4.17.0" /> <PackageReference Include="AutoFixture.Xunit2" Version="4.17.0" /> - <PackageReference Include="Microsoft.AspNetCore.Mvc.Testing" Version="6.0.9" /> - <PackageReference Include="Microsoft.Extensions.Options" Version="6.0.0" /> + <PackageReference Include="Microsoft.AspNetCore.Mvc.Testing" Version="7.0.0" /> + <PackageReference Include="Microsoft.Extensions.Options" Version="7.0.0" /> <PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.3.2" /> <PackageReference Include="xunit" Version="2.4.2" /> <PackageReference Include="xunit.runner.visualstudio" Version="2.4.5"> diff --git a/tests/Jellyfin.XbmcMetadata.Tests/Jellyfin.XbmcMetadata.Tests.csproj b/tests/Jellyfin.XbmcMetadata.Tests/Jellyfin.XbmcMetadata.Tests.csproj index f03448eed..bde34d639 100644 --- a/tests/Jellyfin.XbmcMetadata.Tests/Jellyfin.XbmcMetadata.Tests.csproj +++ b/tests/Jellyfin.XbmcMetadata.Tests/Jellyfin.XbmcMetadata.Tests.csproj @@ -1,7 +1,7 @@ <Project Sdk="Microsoft.NET.Sdk"> <PropertyGroup> - <TargetFramework>net6.0</TargetFramework> + <TargetFramework>net7.0</TargetFramework> <IsPackable>false</IsPackable> <CodeAnalysisRuleSet>../jellyfin-tests.ruleset</CodeAnalysisRuleSet> </PropertyGroup> |
