Skip to content

Commit

Permalink
refactor: use new fake time provider in reports tests
Browse files Browse the repository at this point in the history
  • Loading branch information
meaboutsoftware committed Apr 5, 2024
1 parent 64c7b9e commit 5398353
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -12,6 +13,7 @@ namespace EvolutionaryArchitecture.Fitnet.Reports.IntegrationTests.GenerateNewPa
[UsesVerify]
public sealed class GenerateNewPassesPerMonthReportTests : IClassFixture<FitnetWebApplicationFactory<Program>>, IClassFixture<DatabaseContainer>
{
private static readonly FakeTimeProvider FakeTimeProvider = new(ReportTestCases.FakeNowDate);
private readonly HttpClient _applicationHttpClient;
private readonly ITestHarness _testExternalEventBus;

Expand All @@ -21,7 +23,7 @@ public GenerateNewPassesPerMonthReportTests(FitnetWebApplicationFactory<Program>
var applicationInMemory = applicationInMemoryFactory
.WithContainerDatabaseConfigured(new ReportsDatabaseConfiguration(database.ConnectionString!))
.WithTestEventBus(typeof(ContractSignedEventConsumer))
.SetFakeSystemClock(ReportTestCases.FakeNowDate);
.WithTime(FakeTimeProvider);
_applicationHttpClient = applicationInMemory.CreateClient();
_testExternalEventBus = applicationInMemory.GetTestExternalEventBus();
}
Expand Down

0 comments on commit 5398353

Please sign in to comment.