public static void TestParallelEnumeratorFinish() { Reset(); var parallelCommand = new ParallelCommand(); parallelCommand.Add(() => SetToTrue(0)); parallelCommand.Add(SetToFalseEnumerator(0)); parallelCommand.Run(); Compare(new[] { false }); }
public static void TestParallel2() { Reset(); var parallelCommand = new ParallelCommand(); parallelCommand.Add(() => SetToTrue(0)); parallelCommand.Add(() => SetToTrue(1)); parallelCommand.MoveNext(); Compare(new[] { true, true }); }
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 }); }
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 }); }