diff options
| author | Bond-009 <bond.009@outlook.com> | 2023-06-06 14:31:01 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-06-06 14:31:01 +0200 |
| commit | a4a10f101edf607b72b4e5d5578a877df46818ec (patch) | |
| tree | 2ee0626b8a1d15d1310bcd858ae3a5ef91999d0c | |
| parent | 29368a1566afcbfa861e3cf431156ee0f73f1f2b (diff) | |
| parent | cb788dbd73c8b003b22a2f376289b98cf212f0a4 (diff) | |
Merge pull request #9857 from crobibero/cache-size-tests
| -rw-r--r-- | tests/Jellyfin.Server.Implementations.Tests/Data/SqliteItemRepositoryTests.cs | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/tests/Jellyfin.Server.Implementations.Tests/Data/SqliteItemRepositoryTests.cs b/tests/Jellyfin.Server.Implementations.Tests/Data/SqliteItemRepositoryTests.cs index 7d92e7b26..0d2b488bc 100644 --- a/tests/Jellyfin.Server.Implementations.Tests/Data/SqliteItemRepositoryTests.cs +++ b/tests/Jellyfin.Server.Implementations.Tests/Data/SqliteItemRepositoryTests.cs @@ -6,6 +6,7 @@ using Emby.Server.Implementations.Data; using MediaBrowser.Controller; using MediaBrowser.Controller.Entities; using MediaBrowser.Model.Entities; +using Microsoft.Extensions.Configuration; using Moq; using Xunit; @@ -27,8 +28,18 @@ namespace Jellyfin.Server.Implementations.Tests.Data appHost.Setup(x => x.ReverseVirtualPath(It.IsAny<string>())) .Returns((string x) => x.Replace(MetaDataPath, VirtualMetaDataPath, StringComparison.Ordinal)); + var configSection = new Mock<IConfigurationSection>(); + configSection + .SetupGet(x => x[It.Is<string>(s => s == MediaBrowser.Controller.Extensions.ConfigurationExtensions.SqliteCacheSizeKey)]) + .Returns("0"); + var config = new Mock<IConfiguration>(); + config + .Setup(x => x.GetSection(It.Is<string>(s => s == MediaBrowser.Controller.Extensions.ConfigurationExtensions.SqliteCacheSizeKey))) + .Returns(configSection.Object); + _fixture = new Fixture().Customize(new AutoMoqCustomization { ConfigureMembers = true }); _fixture.Inject(appHost); + _fixture.Inject(config); _sqliteItemRepository = _fixture.Create<SqliteItemRepository>(); } |
