public void VirtualTaskListWithAddedTasks()
        {
            WlbScheduledTasks tasks = BuildSampleTasksWithTimes();
            SortedDictionary <int, WlbScheduledTask> virtualTasks = tasks.VirtualTaskList;

            Assert.AreEqual(3, tasks.TaskList.Count);
            Assert.AreEqual(3, tasks.SortedTaskList.Count);
            Assert.AreEqual(4, virtualTasks.Count);

            //Verify sort keys from the virtual list and their task id
            List <WlbScheduledTask> virtualTasksValues = new List <WlbScheduledTask>(virtualTasks.Values);

            Assert.AreEqual(3, virtualTasksValues[0].TaskId);
            Assert.AreEqual(2, virtualTasksValues[1].TaskId);
            Assert.AreEqual(1, virtualTasksValues[2].TaskId);
            Assert.AreEqual(3, virtualTasksValues[3].TaskId);

            //Next Task
            Assert.IsNull(tasks.GetNextExecutingTask());

            //Last Task
            Assert.IsNotNull(tasks.GetLastExecutingTask());

            //Check performance mode fetch from last task
            Assert.AreEqual(WlbPoolPerformanceMode.MaximizeDensity, tasks.GetCurrentScheduledPerformanceMode());
        }
        public void EmptyConstructorCausesCurrentScheduledPerformanceModeToThrow()
        {
            WlbScheduledTasks tasks = new WlbScheduledTasks();

            tasks.GetCurrentScheduledPerformanceMode();
        }
        public void EmptyConstructorCausesCurrentScheduledPerformanceModeToThrow()
        {
            WlbScheduledTasks tasks = new WlbScheduledTasks();

            Assert.That(() => tasks.GetCurrentScheduledPerformanceMode(), Throws.Exception.With.TypeOf(typeof(IndexOutOfRangeException)));
        }
Example #4
0
        public void EmptyConstructorCausesCurrentScheduledPerformanceModeToThrow()
        {
            var tasks = new WlbScheduledTasks();

            Assert.Throws(typeof(IndexOutOfRangeException), () => tasks.GetCurrentScheduledPerformanceMode());
        }