Beispiel #1
0
        public void Test1()
        {
            DummyScheduler scheduler = new DummyScheduler();

            new Choker(2, scheduler.Call, new Flag());
            Assert.AreEqual(1, scheduler.FunctionCount);
            Assert.AreEqual(10.0, scheduler.GetDelay(0));
            TaskDelegate function = scheduler.GetFunction(0);

            function();

            scheduler.RemoveAt(0);
            Assert.AreEqual(1, scheduler.FunctionCount);
            Assert.AreEqual(10.0, scheduler.GetDelay(0));
            function = scheduler.GetFunction(0);
            function();

            scheduler.RemoveAt(0);
            function = scheduler.GetFunction(0);
            function();

            scheduler.RemoveAt(0);
            function = scheduler.GetFunction(0);
            function();

            scheduler.RemoveAt(0);
            scheduler.GetFunction(0);
        }