protected void Sequential() { var implemntations = new List<IDecorationCommandImplementation>(); foreach (var command in Commands) { var impl = new DecorationFactory().Get(command); impl.Execute(); } }
protected void Sequential() { var implemntations = new List <IDecorationCommandImplementation>(); foreach (var command in Commands) { var impl = new DecorationFactory().Instantiate(command); impl.Execute(); } }
protected void Parallel() { var implementations = new List<IDecorationCommandImplementation>(); foreach (var command in Commands) { var impl = new DecorationFactory().Get(command); implementations.Add(impl); } System.Threading.Tasks.Parallel.ForEach ( implementations, i => i.Execute() ); }
protected void Parallel() { var implementations = new List <IDecorationCommandImplementation>(); foreach (var command in Commands) { var impl = new DecorationFactory().Instantiate(command); implementations.Add(impl); } System.Threading.Tasks.Parallel.ForEach ( implementations, i => i.Execute() ); }
private void ExecuteSetup(SetupXml setup) { try { foreach (var command in setup.Commands) { var skip = false; if (command is IGroupCommand) { var groupCommand = (command as IGroupCommand); if (groupCommand.RunOnce) skip = groupCommand.HasRun; } if (!skip) { var impl = new DecorationFactory().Get(command); impl.Execute(); if (command is IGroupCommand) { var groupCommand = (command as IGroupCommand); groupCommand.HasRun=true; } } } } catch (Exception ex) { HandleExceptionDuringSetup(ex); } }
private void ExecuteCleanup(CleanupXml cleanup) { try { foreach (var command in cleanup.Commands) { var impl = new DecorationFactory().Get(command); impl.Execute(); } } catch (Exception ex) { HandleExceptionDuringCleanup(ex); } }
private void ExecuteChecks(ConditionXml check) { foreach (var predicate in check.Predicates) { var impl = new DecorationFactory().Get(predicate); var isVerified = impl.Validate(); if (!isVerified) Assert.Ignore("This test has been ignored because following check wasn't successful: {0}", impl.Message); } }