Exemplo n.º 1
0
        public async Task WhenIGetShiftsForBabySitter(string firstName, string lastName)
        {
            var sitters = await _fixture.GetBabySitters();

            var sitter = sitters.FindByName(firstName, lastName);
            var shifts = await _fixture.GetBabySitterShifts(sitter.Id);

            ScenarioContext.Current.BabySitterShifts(shifts);
        }
Exemplo n.º 2
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);
        }
        public async Task IShouldSeeBabySitterWithShiftStartingAtWithABedtimeOf(
            string firstName,
            string lastName,
            string startTime,
            string bedtime)
        {
            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);

            Assert.Equal(startTime.ToLocalDateTime(), currentShift.StartTime);
            Assert.Equal(bedtime.ToLocalDateTime(), currentShift.Bedtime);
        }