コード例 #1
0
ファイル: AssignmentTest.cs プロジェクト: 0anion0/IBN
 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);
 }
コード例 #2
0
        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);
        }
コード例 #3
0
ファイル: AssignmentTest.cs プロジェクト: 0anion0/IBN
        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);
        }
コード例 #4
0
        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);
        }