Skip to content

Commit

Permalink
Fix unit tests, missing ICacheService
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexander van Delft committed Dec 9, 2024
1 parent 64e344e commit ef59fa4
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -61,6 +62,7 @@ namespace COMET.Web.Common.Tests.Components.Applications
public class SingleIterationApplicationTemplateTestFixture
{
private Mock<ISingleIterationApplicationTemplateViewModel> viewModel;
private Mock<ICacheService> cacheService;
private SourceList<Iteration> openIterations;
private TestContext context;
private ICDPMessageBus messageBus;
Expand All @@ -72,6 +74,7 @@ public void Setup()
this.context = new TestContext();
this.openIterations = new SourceList<Iteration>();
this.viewModel = new Mock<ISingleIterationApplicationTemplateViewModel>();
this.cacheService = new Mock<ICacheService>();
var sessionService = new Mock<ISessionService>();
sessionService.Setup(x => x.OpenIterations).Returns(this.openIterations);
var session = new Mock<ISession>();
Expand All @@ -86,6 +89,7 @@ public void Setup()
this.context.Services.AddSingleton(mockConfigurationService.Object);
this.context.Services.AddSingleton(new Mock<IStringTableService>().Object);
this.context.Services.AddSingleton(sessionService.Object);
this.context.Services.AddSingleton(this.cacheService.Object);
this.context.Services.AddSingleton(this.messageBus);
this.context.ConfigureDevExpressBlazor();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -64,6 +65,7 @@ public class IndexComponentTestFixture
{
private IIndexViewModel viewModel;
private TestContext context;
private Mock<ICacheService> cacheService;
private Mock<IVersionService> versionService;
private Mock<ISessionService> sessionService;
private Mock<IConfigurationService> serverConnectionService;
Expand All @@ -80,6 +82,7 @@ public void Setup()
this.versionService = new Mock<IVersionService>();
this.sessionService = new Mock<ISessionService>();
this.serverConnectionService = new Mock<IConfigurationService>();
this.cacheService = new Mock<ICacheService>();
var serverConfiguration = new ServerConfiguration { FullTrustConfiguration = new FullTrustConfiguration() };
this.serverConnectionService.Setup(x => x.ServerConfiguration).Returns(serverConfiguration);
this.sourceList = new SourceList<Iteration>();
Expand All @@ -100,6 +103,7 @@ public void Setup()
this.context.Services.AddSingleton<ILoginViewModel, LoginViewModel>();
this.context.Services.AddSingleton<IOpenModelViewModel, OpenModelViewModel>();
this.context.Services.AddSingleton(this.registrationService.Object);
this.context.Services.AddSingleton(this.cacheService.Object);
this.context.ConfigureDevExpressBlazor();
this.authorization = this.context.AddTestAuthorization();

Expand Down

0 comments on commit ef59fa4

Please sign in to comment.