Skip to content

Commit

Permalink
feat: replace system clock with time provider
Browse files Browse the repository at this point in the history
  • Loading branch information
meaboutsoftware committed Apr 2, 2024
1 parent 7088c76 commit ce347bd
Show file tree
Hide file tree
Showing 9 changed files with 15 additions and 15 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
using EvolutionaryArchitecture.Fitnet;
using EvolutionaryArchitecture.Fitnet.Common.Api.ErrorHandling;
using EvolutionaryArchitecture.Fitnet.Common.Core.SystemClock;
using EvolutionaryArchitecture.Fitnet.Offers.Api;
using EvolutionaryArchitecture.Fitnet.Passes.Api;
using EvolutionaryArchitecture.Fitnet.Reports;
Expand All @@ -11,7 +10,6 @@
builder.Services.AddEndpointsApiExplorer();
builder.Services.AddSwaggerGen();

builder.Services.AddSystemClock();
builder.Services.AddFeatureManagement();

builder.Services.AddPasses(builder.Configuration, Module.Passes);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="evolutionaryarchitecture.fitnet.common.core" Version="1.1.8" />
<PackageReference Include="evolutionaryarchitecture.fitnet.common.core" Version="1.3.0" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Bogus" Version="34.0.2" />
<PackageReference Include="evolutionaryarchitecture.fitnet.common.integrationteststoolbox" Version="1.1.8" />
<PackageReference Include="Bogus" Version="35.5.0" />
<PackageReference Include="evolutionaryarchitecture.fitnet.common.integrationteststoolbox" Version="1.3.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.8.0" />
</ItemGroup>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="EvolutionaryArchitecture.Fitnet.Common.Api" Version="1.1.8" />
<PackageReference Include="EvolutionaryArchitecture.Fitnet.Common.Core" Version="1.1.8" />
<PackageReference Include="EvolutionaryArchitecture.Fitnet.Common.Api" Version="1.3.0" />
<PackageReference Include="EvolutionaryArchitecture.Fitnet.Common.Core" Version="1.3.0" />
<PackageReference Include="EvolutionaryArchitecture.Fitnet.Contracts.IntegrationEvents" Version="1.0.7" />
<PackageReference Include="MassTransit.EntityFrameworkCore" Version="8.1.3" />
<PackageReference Include="MassTransit.RabbitMQ" Version="8.1.3" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
<PackageReference Include="MassTransit.RabbitMQ" Version="8.1.3" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="evolutionaryarchitecture.fitnet.common.infrastructure" Version="1.1.8" />
<PackageReference Include="evolutionaryarchitecture.fitnet.common.infrastructure" Version="1.3.0" />
</ItemGroup>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="evolutionaryarchitecture.fitnet.common.api" Version="1.1.8" />
<PackageReference Include="evolutionaryarchitecture.fitnet.common.integrationteststoolbox" Version="1.1.8" />
<PackageReference Include="evolutionaryarchitecture.fitnet.common.api" Version="1.3.0" />
<PackageReference Include="evolutionaryarchitecture.fitnet.common.integrationteststoolbox" Version="1.3.0" />
<PackageReference Include="evolutionaryarchitecture.fitnet.contracts.integrationevents" Version="1.0.7" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.8.0" />
</ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="Dapper" Version="2.1.24" />
<PackageReference Include="evolutionaryarchitecture.fitnet.common.api" Version="1.1.8" />
<PackageReference Include="evolutionaryarchitecture.fitnet.common.core" Version="1.1.8" />
<PackageReference Include="EvolutionaryArchitecture.Fitnet.Common.Infrastructure" Version="1.1.8" />
<PackageReference Include="evolutionaryarchitecture.fitnet.common.api" Version="1.3.0" />
<PackageReference Include="evolutionaryarchitecture.fitnet.common.core" Version="1.3.0" />
<PackageReference Include="EvolutionaryArchitecture.Fitnet.Common.Infrastructure" Version="1.3.0" />
<PackageReference Include="MassTransit.RabbitMQ" Version="8.1.3" />
<PackageReference Include="Microsoft.AspNetCore.OpenApi" Version="8.0.0" />
<PackageReference Include="Npgsql" Version="8.0.1" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="evolutionaryarchitecture.fitnet.common.integrationteststoolbox" Version="1.1.8" />
<PackageReference Include="evolutionaryarchitecture.fitnet.common.integrationteststoolbox" Version="1.3.0" />
<PackageReference Include="evolutionaryarchitecture.fitnet.contracts.integrationevents" Version="1.0.7" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.8.0" />
</ItemGroup>
Expand Down
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.SystemClock;
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 FakeSystemTimeProvider FakeTimeProvider = new();
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 ce347bd

Please sign in to comment.