private static IEnumerable <TestPartition> GenerateTestPartitions(IEnumerable <ITestCommand> commands) { TestPartition currentPartition = null; int currentOrder = int.MinValue; foreach (ITestCommand command in commands) { if (command.Test.Order != currentOrder) { if (currentPartition != null) { yield return(currentPartition); currentPartition = null; } currentOrder = command.Test.Order; } if (currentPartition == null) { currentPartition = new TestPartition(); } PatternTest test = command.Test as PatternTest; if (test != null && test.IsParallelizable && command.Dependencies.Count == 0) { currentPartition.ParallelCommands.Add(command); } else { currentPartition.SequentialCommands.Add(command); } } if (currentPartition != null) { yield return(currentPartition); } }
private static IEnumerable<TestPartition> GenerateTestPartitions(IEnumerable<ITestCommand> commands) { TestPartition currentPartition = null; int currentOrder = int.MinValue; foreach (ITestCommand command in commands) { if (command.Test.Order != currentOrder) { if (currentPartition != null) { yield return currentPartition; currentPartition = null; } currentOrder = command.Test.Order; } if (currentPartition == null) currentPartition = new TestPartition(); PatternTest test = command.Test as PatternTest; if (test != null && test.IsParallelizable && command.Dependencies.Count == 0) { currentPartition.ParallelCommands.Add(command); } else { currentPartition.SequentialCommands.Add(command); } } if (currentPartition != null) yield return currentPartition; }