Exemplo n.º 1
0
        public static void TestParallelEnumeratorFinish()
        {
            Reset();

            var parallelCommand = new ParallelCommand();

            parallelCommand.Add(() => SetToTrue(0));
            parallelCommand.Add(SetToFalseEnumerator(0));
            parallelCommand.Run();
            Compare(new[] { false });
        }
Exemplo n.º 2
0
        public static void TestParallel2()
        {
            Reset();

            var parallelCommand = new ParallelCommand();

            parallelCommand.Add(() => SetToTrue(0));
            parallelCommand.Add(() => SetToTrue(1));

            parallelCommand.MoveNext();
            Compare(new[] { true, true });
        }
Exemplo n.º 3
0
        public static void TestComposite1()
        {
            Reset();

            var serialCommand = new SerialCommand();

            serialCommand.Add(() => SetToTrue(0));

            var parallelCommand = new ParallelCommand();

            parallelCommand.Add(() => SetToFalse(0));
            parallelCommand.Add(() => SetToTrue(1));

            serialCommand.Add(parallelCommand);
            serialCommand.Run();

            Compare(new[] { false, true });
        }
Exemplo n.º 4
0
        public static void TestParallelEnumerator8()
        {
            Reset();

            var parallelCommand = new ParallelCommand();

            parallelCommand.Add(SetToTrueEnumerator(0));
            parallelCommand.Add(SetToTrueEnumerator(1));

            var serialCommand = new SerialCommand();

            serialCommand.Add(() => SetToFalse(0));
            serialCommand.Add(() => SetToFalse(1));

            var fullCommand = new SerialCommand();

            fullCommand.Add(parallelCommand);
            fullCommand.Add(serialCommand);

            fullCommand.Run();
            Compare(new[] { false, false });
        }