Skip to content

Commit

Permalink
Merge branch 'main' into bump_dotnet_nuget
Browse files Browse the repository at this point in the history
  • Loading branch information
johevemi committed Dec 4, 2024
2 parents b2ac97b + 2720d48 commit 74b4daa
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/ci-dotnet.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ jobs:
uses: Energinet-DataHub/.github/.github/workflows/dotnet-postbuild-test.yml@v14
with:
download_attempt_limit: 30
azure_functions_core_tools_version: 4.0.5413
# Matrix parameters
job_name: Unit Tests ${{ matrix.tests_filter_expression.name }}
tests_dll_file_path: ${{ matrix.tests_filter_expression.paths }}
Expand Down Expand Up @@ -132,6 +133,7 @@ jobs:
uses: Energinet-DataHub/.github/.github/workflows/dotnet-postbuild-test.yml@v14
with:
download_attempt_limit: 30
azure_functions_core_tools_version: 4.0.5413
azure_integrationtest_tenant_id: ${{ vars.integration_test_azure_tenant_id }}
azure_integrationtest_subscription_id: ${{ vars.integration_test_azure_subscription_id }}
azure_integrationtest_spn_id: ${{ vars.integration_test_azure_spn_id_oidc }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,14 +96,17 @@ public async Task Validate_WhenPeriodStartAndPeriodEndAreInvalidFormat_ReturnsUn
// Arrange
var now = SystemClock.Instance.GetCurrentInstant().ToDateTimeOffset();

var startToYearsAgo = now.AddYears(-2);
var endToYearsAgo = now.AddYears(-2).AddMonths(1);

var request = new WholesaleServicesRequestBuilder()
.WithPeriodStart(
new LocalDateTime(now.Year - 2, now.Month, 1, 17, 45, 12)
new LocalDateTime(startToYearsAgo.Year, startToYearsAgo.Month, 1, 17, 45, 12)
.InZoneStrictly(DateTimeZoneProviders.Tzdb.GetZoneOrNull("Europe/Copenhagen")!)
.ToInstant()
.ToString())
.WithPeriodEnd(
new LocalDateTime(now.Year - 2, now.Month + 1, 1, 8, 13, 56)
new LocalDateTime(endToYearsAgo.Year, endToYearsAgo.Month, 1, 8, 13, 56)
.InZoneStrictly(DateTimeZoneProviders.Tzdb.GetZoneOrNull("Europe/Copenhagen")!)
.ToInstant()
.ToString())
Expand All @@ -113,8 +116,7 @@ public async Task Validate_WhenPeriodStartAndPeriodEndAreInvalidFormat_ReturnsUn
var validationErrors = await _sut.ValidateAsync(request);

// Assert
validationErrors.Should().HaveCount(2);
validationErrors.Select(e => e.ErrorCode).Should().BeEquivalentTo(["D66", "D66"]);
validationErrors.Where(x => x.ErrorCode == "D66").Should().HaveCount(2);
}

[Fact]
Expand Down

0 comments on commit 74b4daa

Please sign in to comment.