AllocateResource() public method

public AllocateResource ( Resource resource, System.DateTime fromDate, System.DateTime toDate, int dailyload ) : void
resource Resource
fromDate System.DateTime
toDate System.DateTime
dailyload int
return void
Esempio n. 1
0
        public void RaiseIfResourceIsNull()
        {
            Project project = new Project();

            DateTime fromDate = new DateTime(2012, 9, 18);
            DateTime toDate = new DateTime(2012, 9, 20);
            int dailyload = 6;

            project.AllocateResource(null, fromDate, toDate, dailyload);
        }
Esempio n. 2
0
        public void AllocateResourceToProject()
        {
            Project project = new Project();
            Resource resource = new Resource();

            DateTime fromDate = new DateTime(2012, 9, 18);
            DateTime toDate = new DateTime(2012, 9, 20);
            int dailyload = 6;

            project.AllocateResource(resource, fromDate, toDate, dailyload);

            var result = project.GetDailyLoad(resource, fromDate);
            Assert.AreEqual(6, result);
            result = project.GetDailyLoad(resource, fromDate.AddDays(-1));
            Assert.AreEqual(0, result);
        }
Esempio n. 3
0
        public void AllocateResourceTwoWeeksToProjectSkippingWeekEnd()
        {
            Project project = new Project();
            Resource resource = new Resource();

            DateTime fromDate = new DateTime(2012, 9, 11);
            DateTime toDate = new DateTime(2012, 9, 21);
            DateTime saturday = new DateTime(2012, 9, 15);
            DateTime sunday = new DateTime(2012, 9, 16);
            int dailyload = 6;

            project.AllocateResource(resource, fromDate, toDate, dailyload);

            var result = project.GetDailyLoad(resource, saturday);
            Assert.AreEqual(0, result);
            result = project.GetDailyLoad(resource, sunday);
            Assert.AreEqual(0, result);
        }