From 539835358446a996efce877a95815f824f0074c5 Mon Sep 17 00:00:00 2001 From: Maciej Jedrzejewski Date: Thu, 4 Apr 2024 08:34:56 +0200 Subject: [PATCH] refactor: use new fake time provider in reports tests --- .../GenerateNewPassesPerMonthReportTests.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Chapter-4-applying-tactical-domain-driven-design/Fitnet/Src/Reports/Tests/Fitnet.Reports.IntegrationTests/GenerateNewPassesPerMonthReport/GenerateNewPassesPerMonthReportTests.cs b/Chapter-4-applying-tactical-domain-driven-design/Fitnet/Src/Reports/Tests/Fitnet.Reports.IntegrationTests/GenerateNewPassesPerMonthReport/GenerateNewPassesPerMonthReportTests.cs index cc22c60e..42f4a0c0 100644 --- a/Chapter-4-applying-tactical-domain-driven-design/Fitnet/Src/Reports/Tests/Fitnet.Reports.IntegrationTests/GenerateNewPassesPerMonthReport/GenerateNewPassesPerMonthReportTests.cs +++ b/Chapter-4-applying-tactical-domain-driven-design/Fitnet/Src/Reports/Tests/Fitnet.Reports.IntegrationTests/GenerateNewPassesPerMonthReport/GenerateNewPassesPerMonthReportTests.cs @@ -3,6 +3,7 @@ namespace EvolutionaryArchitecture.Fitnet.Reports.IntegrationTests.GenerateNewPa using Common.IntegrationTestsToolbox.TestEngine; using Common.IntegrationTestsToolbox.TestEngine.Configuration; using Common.IntegrationTestsToolbox.TestEngine.EventBus; +using Common.IntegrationTestsToolbox.TestEngine.Time; using EvolutionaryArchitecture.Fitnet.Common.IntegrationTestsToolbox.TestEngine.Database; using GenerateNewPassesRegistrationsPerMonthReport.Dtos; using Passes.Api.RegisterPass; @@ -12,6 +13,7 @@ namespace EvolutionaryArchitecture.Fitnet.Reports.IntegrationTests.GenerateNewPa [UsesVerify] public sealed class GenerateNewPassesPerMonthReportTests : IClassFixture>, IClassFixture { + private static readonly FakeTimeProvider FakeTimeProvider = new(ReportTestCases.FakeNowDate); private readonly HttpClient _applicationHttpClient; private readonly ITestHarness _testExternalEventBus; @@ -21,7 +23,7 @@ public GenerateNewPassesPerMonthReportTests(FitnetWebApplicationFactory var applicationInMemory = applicationInMemoryFactory .WithContainerDatabaseConfigured(new ReportsDatabaseConfiguration(database.ConnectionString!)) .WithTestEventBus(typeof(ContractSignedEventConsumer)) - .SetFakeSystemClock(ReportTestCases.FakeNowDate); + .WithTime(FakeTimeProvider); _applicationHttpClient = applicationInMemory.CreateClient(); _testExternalEventBus = applicationInMemory.GetTestExternalEventBus(); }