Skip to content

Commit

Permalink
test ended time
Browse files Browse the repository at this point in the history
  • Loading branch information
vbelinschi committed Sep 10, 2024
1 parent fe69740 commit bdc9d2e
Showing 1 changed file with 11 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
using Energinet.DataHub.SettlementReport.Test.Core.Fixture.Database;
using Energinet.DataHub.Wholesale.CalculationResults.IntegrationTests.Fixtures;
using Microsoft.EntityFrameworkCore;
using Moq;
using NodaTime;
using Xunit;

Expand All @@ -48,6 +49,8 @@ public sealed class SettlementReportFinalizeHandlerIntegrationTests : TestBase<S
null,
null));

private readonly Instant _instant = Instant.FromUtc(2021, 1, 1, 0, 0);

public SettlementReportFinalizeHandlerIntegrationTests(
WholesaleDatabaseFixture<SettlementReportDatabaseContext> wholesaleDatabaseFixture,
SettlementReportFileBlobStorageFixture settlementReportFileBlobStorageFixture)
Expand All @@ -59,6 +62,13 @@ public SettlementReportFinalizeHandlerIntegrationTests(

var blobContainerClient = settlementReportFileBlobStorageFixture.CreateBlobContainerClient();
Fixture.Inject<ISettlementReportFileRepository>(new SettlementReportFileBlobStorage(blobContainerClient));

var clockMock = new Mock<IClock>();
clockMock
.Setup(clock => clock.GetCurrentInstant())
.Returns(_instant);

Fixture.Inject<IClock>(clockMock.Object);
}

[Fact]
Expand Down Expand Up @@ -117,6 +127,7 @@ public async Task FinalizeAsync_CompletesReportRequest()
await using var dbContextAct = _wholesaleDatabaseFixture.DatabaseManager.CreateDbContext();
var completedRequest = await dbContextAct.SettlementReports.SingleAsync(r => r.RequestId == requestId.Id);
Assert.Equal(SettlementReportStatus.Completed, completedRequest.Status);
Assert.Equal(_instant, completedRequest.EndedDateTime);
}

private Task MakeTestFileAsync(GeneratedSettlementReportFileDto file)
Expand Down

0 comments on commit bdc9d2e

Please sign in to comment.