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 EmptyConstructorCausesLastTaskToThrow() { WlbScheduledTasks tasks = new WlbScheduledTasks(); tasks.GetLastExecutingTask(); }
public void EmptyConstructorCausesLastTaskToThrow() { WlbScheduledTasks tasks = new WlbScheduledTasks(); Assert.That(() => tasks.GetLastExecutingTask(), Throws.Exception.With.TypeOf(typeof(IndexOutOfRangeException))); }
public void EmptyConstructorCausesLastTaskToThrow() { var tasks = new WlbScheduledTasks(); Assert.Throws(typeof(IndexOutOfRangeException), () => tasks.GetLastExecutingTask()); }