public void CalendarTest() { WorkCalendarFactory calFactory = new WorkCalendarFactory(); WorkCalendarBase calendar = calFactory.Create<DefaultCalendar>(null); long start = CalendarHelper.Tick2Milis(new DateTime(2008, 01, 01).Ticks); start += CalendarHelper.MilisPerHour(); long duration = CalendarHelper.MilisPerHour() * 1; long result = calendar.AddDuration(start, duration, false); duration = calendar.SubstractDates(result, start, false); }
public void CalendarTest() { WorkCalendarFactory calFactory = new WorkCalendarFactory(); WorkCalendarBase calendar = calFactory.Create <DefaultCalendar>(null); long start = CalendarHelper.Tick2Milis(new DateTime(2008, 01, 01).Ticks); start += CalendarHelper.MilisPerHour(); long duration = CalendarHelper.MilisPerHour() * 1; long result = calendar.AddDuration(start, duration, false); duration = calendar.SubstractDates(result, start, false); }
public void SetActualWorkTest() { WorkCalendarFactory calFactory = new WorkCalendarFactory(); ContourFactory factory = new ContourFactory(); AbstractContour contourBucket = factory.Create<StandardContour>(ContourTypes.FrontLoaded); WorkCalendarBase calendar = calFactory.Create<DefaultCalendar>(null); Task task = new Task(); task.Start = CalendarHelper.Tick2Milis(new DateTime(2008, 01, 01).Ticks); Assignment assignment = new Assignment(task, calendar, contourBucket, 1.0, 0); long duration = CalendarHelper.MilisPerHour() * 13 + CalendarHelper.MilisPerMinute() * 20; assignment.Duration = duration; long work = assignment.GetWork(assignment.Start, assignment.End); assignment.SetActualWork(CalendarHelper.MilisPerMinute() * 48); }
public void SetActualWorkTest() { WorkCalendarFactory calFactory = new WorkCalendarFactory(); ContourFactory factory = new ContourFactory(); AbstractContour contourBucket = factory.Create <StandardContour>(ContourTypes.FrontLoaded); WorkCalendarBase calendar = calFactory.Create <DefaultCalendar>(null); Task task = new Task(); task.Start = CalendarHelper.Tick2Milis(new DateTime(2008, 01, 01).Ticks); Assignment assignment = new Assignment(task, calendar, contourBucket, 1.0, 0); long duration = CalendarHelper.MilisPerHour() * 13 + CalendarHelper.MilisPerMinute() * 20; assignment.Duration = duration; long work = assignment.GetWork(assignment.Start, assignment.End); assignment.SetActualWork(CalendarHelper.MilisPerMinute() * 48); }