Merge pull request 'Фикс тестов и фикс проверки даты суточного отчета' (#180) from fix/daily_report_tests_and_cheking_date into dev

Reviewed-on: http://test.digitaldrilling.ru:8080/DDrilling/AsbCloudServer/pulls/180
This commit is contained in:
Никита Фролов 2023-12-21 11:38:40 +05:00
commit bf83987ba5
2 changed files with 12 additions and 1 deletions

View File

@ -420,6 +420,6 @@ public class DailyReportService : IDailyReportService
var from = DateOnly.FromDateTime(datesRange.From);
var to = DateOnly.FromDateTime(datesRange.To);
return from >= dateDailyReport && dateDailyReport <= to;
return dateDailyReport >= from && dateDailyReport <= to;
}
}

View File

@ -196,6 +196,11 @@ public class DailyReportServiceTest
KUsage = 30
};
private readonly SimpleTimezoneDto fakeWellTimezone = new()
{
Hours = 5,
};
private readonly IWellService wellServiceMock = Substitute.For<IWellService>();
private readonly ITrajectoryNnbRepository trajectoryFactNnbRepositoryMock = Substitute.For<ITrajectoryNnbRepository>();
private readonly IDailyReportRepository dailyReportRepositoryMock = Substitute.For<IDailyReportRepository>();
@ -281,6 +286,9 @@ public class DailyReportServiceTest
processMapReportWellDrillingServiceMock.GetAsync(Arg.Any<int>(), Arg.Any<CancellationToken>())
.ReturnsForAnyArgs(new[] { fakeProcessMapReportWellDrilling });
wellServiceMock.GetTimezone(Arg.Any<int>())
.ReturnsForAnyArgs(fakeWellTimezone);
}
[Fact]
@ -527,6 +535,9 @@ public class DailyReportServiceTest
yield return new object[]
{
new DateOnly(2090, 01, 01),
};
yield return new object[]
{
new DateOnly(2000, 01, 01)
};
}