Skip to content

Commit

Permalink
updated
Browse files Browse the repository at this point in the history
  • Loading branch information
MadsDue committed Dec 2, 2024
1 parent 2107f7b commit d5e82be
Showing 1 changed file with 3 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -83,16 +83,14 @@ 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(startToYearsAgo.Year, startToYearsAgo.Month, 1, 17, 45, 12)
new LocalDateTime(now.Year - 2, now.Month, 1, 17, 45, 12)
.InZoneStrictly(DateTimeZoneProviders.Tzdb.GetZoneOrNull("Europe/Copenhagen")!)
.ToInstant()
.ToString())
.WithPeriodEnd(
new LocalDateTime(endToYearsAgo.Year, endToYearsAgo.Month, 1, 8, 13, 56)
new LocalDateTime(now.Year - 2, now.Month + 1, 1, 8, 13, 56)
.InZoneStrictly(DateTimeZoneProviders.Tzdb.GetZoneOrNull("Europe/Copenhagen")!)
.ToInstant()
.ToString())
Expand All @@ -102,8 +100,7 @@ public async Task Validate_WhenPeriodStartAndPeriodEndAreInvalidFormat_ReturnsUn
var validationErrors = await _sut.ValidateAsync(request);

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

[Fact]
Expand Down

0 comments on commit d5e82be

Please sign in to comment.