예제 #1
0
        public async Task WhenBabySitterLeaves(string firstName, string lastName, string endTime)
        {
            var sitters = await _fixture.GetBabySitters();

            var sitter = sitters.FindByName(firstName, lastName);

            var shifts = await _fixture.GetBabySitterShifts(sitter.Id);

            var currentShift = shifts.Single(s => s.EndTime == null);

            var endDateTime = endTime.ToLowerInvariant().Contains("am")
                ? endTime.ToLocalDateTime().PlusDays(1)
                : endTime.ToLocalDateTime();

            await _fixture.EndShift(sitter.Id, currentShift.Id, endDateTime);

            ScenarioContext.Current.EndedShiftId(currentShift.Id);
        }