Inheritance: TaskCommon
Exemple #1
0
        public void Execute()
        {
            IEnumerable <ITask> list = new List<ITask> ();
            var iter = list.GetEnumerator ();
            IteratorHandler handler = () => iter;
            var task = new IterativeTask (handler);

            Assert.AreEqual (iter, task.Execute (), "#1");
            Assert.IsNull (task.LinkedIterator, "#2");
        }
Exemple #2
0
        public void CtorSideEffect()
        {
            IteratorHandler handler = () => null;
            var task = new IterativeTask (handler);

            Assert.IsNull (task.ArbiterCleanupHandler, "#1");
            try {
                var x = task [0];
                Assert.Fail ("#2");
            } catch (NotSupportedException) {}
            try {
                task [0] = new PortElement<int> (10);
                Assert.Fail ("#2");
            } catch (NotSupportedException) {}

            Assert.AreEqual (handler, task.Handler, "#3");
            Assert.IsNull (task.LinkedIterator, "#4");
            Assert.IsNull (task.LinkedIterator, "#5");
            Assert.IsNull (task.TaskQueue, "#6");
        }