diff options
| author | Bond-009 <bond.009@outlook.com> | 2023-10-22 17:01:51 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-10-22 09:01:51 -0600 |
| commit | b16033df03db7a6c3e3b3636c9eac4dad8e49f9d (patch) | |
| tree | 1dc4bd20c2a28f13078040fd6036a65f2b615eb5 /fuzz/Emby.Server.Implementations.Fuzz/Program.cs | |
| parent | 028b2122ce39ec54bcab78ffd252a41518231458 (diff) | |
Fix fuzz projects (#10416)
Diffstat (limited to 'fuzz/Emby.Server.Implementations.Fuzz/Program.cs')
| -rw-r--r-- | fuzz/Emby.Server.Implementations.Fuzz/Program.cs | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/fuzz/Emby.Server.Implementations.Fuzz/Program.cs b/fuzz/Emby.Server.Implementations.Fuzz/Program.cs index 03b296494..1571b5ab0 100644 --- a/fuzz/Emby.Server.Implementations.Fuzz/Program.cs +++ b/fuzz/Emby.Server.Implementations.Fuzz/Program.cs @@ -6,6 +6,7 @@ using Emby.Server.Implementations.Library; using MediaBrowser.Controller; using MediaBrowser.Controller.Entities; using MediaBrowser.Model.Entities; +using Microsoft.Extensions.Configuration; using Moq; using SharpFuzz; @@ -54,8 +55,16 @@ namespace Emby.Server.Implementations.Fuzz 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); + IFixture fixture = new Fixture().Customize(new AutoMoqCustomization { ConfigureMembers = true }); fixture.Inject(appHost); + fixture.Inject(config); return fixture.Create<SqliteItemRepository>(); } } |
