forked from ddrilling/AsbCloudServer
Фикс тестов и фикс проверки даты суточного отчета
This commit is contained in:
parent
576d4d0e57
commit
9a08ed1687
@ -420,6 +420,6 @@ public class DailyReportService : IDailyReportService
|
|||||||
var from = DateOnly.FromDateTime(datesRange.From);
|
var from = DateOnly.FromDateTime(datesRange.From);
|
||||||
var to = DateOnly.FromDateTime(datesRange.To);
|
var to = DateOnly.FromDateTime(datesRange.To);
|
||||||
|
|
||||||
return from >= dateDailyReport && dateDailyReport <= to;
|
return dateDailyReport >= from && dateDailyReport <= to;
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -196,6 +196,11 @@ public class DailyReportServiceTest
|
|||||||
KUsage = 30
|
KUsage = 30
|
||||||
};
|
};
|
||||||
|
|
||||||
|
private readonly SimpleTimezoneDto fakeWellTimezone = new()
|
||||||
|
{
|
||||||
|
Hours = 5,
|
||||||
|
};
|
||||||
|
|
||||||
private readonly IWellService wellServiceMock = Substitute.For<IWellService>();
|
private readonly IWellService wellServiceMock = Substitute.For<IWellService>();
|
||||||
private readonly ITrajectoryNnbRepository trajectoryFactNnbRepositoryMock = Substitute.For<ITrajectoryNnbRepository>();
|
private readonly ITrajectoryNnbRepository trajectoryFactNnbRepositoryMock = Substitute.For<ITrajectoryNnbRepository>();
|
||||||
private readonly IDailyReportRepository dailyReportRepositoryMock = Substitute.For<IDailyReportRepository>();
|
private readonly IDailyReportRepository dailyReportRepositoryMock = Substitute.For<IDailyReportRepository>();
|
||||||
@ -281,6 +286,9 @@ public class DailyReportServiceTest
|
|||||||
|
|
||||||
processMapReportWellDrillingServiceMock.GetAsync(Arg.Any<int>(), Arg.Any<CancellationToken>())
|
processMapReportWellDrillingServiceMock.GetAsync(Arg.Any<int>(), Arg.Any<CancellationToken>())
|
||||||
.ReturnsForAnyArgs(new[] { fakeProcessMapReportWellDrilling });
|
.ReturnsForAnyArgs(new[] { fakeProcessMapReportWellDrilling });
|
||||||
|
|
||||||
|
wellServiceMock.GetTimezone(Arg.Any<int>())
|
||||||
|
.ReturnsForAnyArgs(fakeWellTimezone);
|
||||||
}
|
}
|
||||||
|
|
||||||
[Fact]
|
[Fact]
|
||||||
@ -527,6 +535,9 @@ public class DailyReportServiceTest
|
|||||||
yield return new object[]
|
yield return new object[]
|
||||||
{
|
{
|
||||||
new DateOnly(2090, 01, 01),
|
new DateOnly(2090, 01, 01),
|
||||||
|
};
|
||||||
|
yield return new object[]
|
||||||
|
{
|
||||||
new DateOnly(2000, 01, 01)
|
new DateOnly(2000, 01, 01)
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user