From ef59fa4dddd6b2f05befb7b7d5c43cb35d5294e7 Mon Sep 17 00:00:00 2001 From: Alexander van Delft Date: Mon, 9 Dec 2024 09:31:56 +0100 Subject: [PATCH] Fix unit tests, missing ICacheService --- .../SingleIterationApplicationTemplateTestFixture.cs | 4 ++++ .../Components/IndexComponentTestFixture.cs | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/COMET.Web.Common.Tests/Components/Applications/SingleIterationApplicationTemplateTestFixture.cs b/COMET.Web.Common.Tests/Components/Applications/SingleIterationApplicationTemplateTestFixture.cs index 22d432fa..729e4326 100644 --- a/COMET.Web.Common.Tests/Components/Applications/SingleIterationApplicationTemplateTestFixture.cs +++ b/COMET.Web.Common.Tests/Components/Applications/SingleIterationApplicationTemplateTestFixture.cs @@ -38,6 +38,7 @@ namespace COMET.Web.Common.Tests.Components.Applications using COMET.Web.Common.Components.Selectors; using COMET.Web.Common.Extensions; using COMET.Web.Common.Model.Configuration; + using COMET.Web.Common.Services.Cache; using COMET.Web.Common.Services.ConfigurationService; using COMET.Web.Common.Services.SessionManagement; using COMET.Web.Common.Services.StringTableService; @@ -61,6 +62,7 @@ namespace COMET.Web.Common.Tests.Components.Applications public class SingleIterationApplicationTemplateTestFixture { private Mock viewModel; + private Mock cacheService; private SourceList openIterations; private TestContext context; private ICDPMessageBus messageBus; @@ -72,6 +74,7 @@ public void Setup() this.context = new TestContext(); this.openIterations = new SourceList(); this.viewModel = new Mock(); + this.cacheService = new Mock(); var sessionService = new Mock(); sessionService.Setup(x => x.OpenIterations).Returns(this.openIterations); var session = new Mock(); @@ -86,6 +89,7 @@ public void Setup() this.context.Services.AddSingleton(mockConfigurationService.Object); this.context.Services.AddSingleton(new Mock().Object); this.context.Services.AddSingleton(sessionService.Object); + this.context.Services.AddSingleton(this.cacheService.Object); this.context.Services.AddSingleton(this.messageBus); this.context.ConfigureDevExpressBlazor(); } diff --git a/COMET.Web.Common.Tests/Components/IndexComponentTestFixture.cs b/COMET.Web.Common.Tests/Components/IndexComponentTestFixture.cs index f9522088..f4e0f132 100644 --- a/COMET.Web.Common.Tests/Components/IndexComponentTestFixture.cs +++ b/COMET.Web.Common.Tests/Components/IndexComponentTestFixture.cs @@ -39,6 +39,7 @@ namespace COMET.Web.Common.Tests.Components using COMET.Web.Common.Extensions; using COMET.Web.Common.Model; using COMET.Web.Common.Model.Configuration; + using COMET.Web.Common.Services.Cache; using COMET.Web.Common.Services.ConfigurationService; using COMET.Web.Common.Services.RegistrationService; using COMET.Web.Common.Services.SessionManagement; @@ -64,6 +65,7 @@ public class IndexComponentTestFixture { private IIndexViewModel viewModel; private TestContext context; + private Mock cacheService; private Mock versionService; private Mock sessionService; private Mock serverConnectionService; @@ -80,6 +82,7 @@ public void Setup() this.versionService = new Mock(); this.sessionService = new Mock(); this.serverConnectionService = new Mock(); + this.cacheService = new Mock(); var serverConfiguration = new ServerConfiguration { FullTrustConfiguration = new FullTrustConfiguration() }; this.serverConnectionService.Setup(x => x.ServerConfiguration).Returns(serverConfiguration); this.sourceList = new SourceList(); @@ -100,6 +103,7 @@ public void Setup() this.context.Services.AddSingleton(); this.context.Services.AddSingleton(); this.context.Services.AddSingleton(this.registrationService.Object); + this.context.Services.AddSingleton(this.cacheService.Object); this.context.ConfigureDevExpressBlazor(); this.authorization = this.context.AddTestAuthorization();