Skip to content

Commit

Permalink
Fix unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexander van Delft committed Dec 21, 2023
1 parent f19f05c commit f0d374f
Showing 1 changed file with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ namespace CometServer.Tests.SideEffects
using CDP4Common.DTO;
using CDP4Common.MetaInfo;

using CometServer.Helpers;
using CometServer.Services;
using CometServer.Services.Authorization;
using CometServer.Services.Operations;
Expand All @@ -56,20 +57,26 @@ internal class ModelCreatorManagerTestFixture

private Mock<IEngineeringModelSetupService> modelSetupService;

private Mock<ICdp4TransactionManager> transactionManager;

[SetUp]
public void Setup()
{
this.RequestUtils = new Mock<IRequestUtils>();
this.MetainfoProvider = new Mock<IMetaInfoProvider>();
this.modelSetupService = new Mock<IEngineeringModelSetupService>();
this.transactionManager = new Mock<ICdp4TransactionManager>();

this.modelCreatorManager = new ModelCreatorManager()
{
RequestUtils = this.RequestUtils.Object,
MetainfoProvider = this.MetainfoProvider.Object,
EngineeringModelSetupService = this.modelSetupService.Object
EngineeringModelSetupService = this.modelSetupService.Object,
TransactionManager = this.transactionManager.Object
};

this.transactionManager.Setup(x => x.GetTransactionTime(It.IsAny<NpgsqlTransaction>())).Returns(DateTime.Now);

this.RequestUtils.Setup(x => x.QueryParameters).Returns(new QueryParameters());
this.RequestUtils.Setup(x => x.Cache).Returns(new List<Thing>());

Expand Down

0 comments on commit f0d374f

Please sign in to comment.