This commit is contained in:
Jim Paine 2020-05-06 14:38:35 +01:00
Родитель 3e2745ba2c
Коммит 56907ae1aa
2 изменённых файлов: 3 добавлений и 3 удалений

Просмотреть файл

@ -270,7 +270,7 @@ namespace Project.Zap.Tests
}
[Fact]
public async Task ViewShifts_Shifts_AfterToday()
public async Task ViewShifts_Shifts_AfterOrEqualToNow()
{
// Arrange
IRepository<Library.Models.Shift> shiftRepository = Substitute.For<IRepository<Library.Models.Shift>>();
@ -285,7 +285,7 @@ namespace Project.Zap.Tests
// Assert
#pragma warning disable CS4014 // Because this call is not awaited, execution of the current method continues before the call is completed
shiftRepository.Received(1).Get(
"SELECT * FROM c WHERE c.EmployeeId = @employeeId AND c.StartDateTime > @start",
"SELECT * FROM c WHERE c.EmployeeId = @employeeId AND c.StartDateTime >= @start",
Arg.Is<Dictionary<string, object>>(x => x.ContainsKey("@employeeId") && x.ContainsKey("@start")));
#pragma warning restore CS4014 // Because this call is not awaited, execution of the current method continues before the call is completed
}

Просмотреть файл

@ -171,7 +171,7 @@ namespace Project.Zap.Controllers
}
IEnumerable<Shift> shifts = await this.shiftRepository.Get(
"SELECT * FROM c WHERE c.EmployeeId = @employeeId AND c.StartDateTime > @start",
"SELECT * FROM c WHERE c.EmployeeId = @employeeId AND c.StartDateTime >= @start",
new Dictionary<string, object> { { "@employeeId", id.Value }, { "@start", DateTime.Now } });
if (shifts?.Any() == false)