Exemplo n.º 1
0
        public void CanUpdateIntervals()
        {
            var res = api.Schedules.CreateSchedule(new Schedule()
            {
                Name = "Test Schedule",
                TimeZone = "Pacific Time (US & Canada)"
            });

            Assert.Greater(res.Schedule.Id, 0);

            var work = new WorkWeek();
            work.Intervals = res.Schedule.Intervals;

            work.Intervals[0].StartTime = 1860;
            work.Intervals[0].EndTime = 2460;
            var update = api.Schedules.UpdateIntervals(res.Schedule.Id.Value, work);

            Assert.Greater(update.WorkWeek.Intervals.Count, 0);

            Assert.AreEqual(work.Intervals[0].EndTime, update.WorkWeek.Intervals[0].EndTime);
            Assert.True(api.Schedules.DeleteSchedule(res.Schedule.Id.Value));
        }
Exemplo n.º 2
0
 public IndividualScheduleWorkWeekResponse UpdateIntervals(long scheduleId, WorkWeek workweek)
 {
     var body = new { workweek };
     return GenericPut<IndividualScheduleWorkWeekResponse>(string.Format("business_hours/schedules/{0}/workweek.json", scheduleId), body);
 }