Ejemplo n.º 1
0
 protected void Sequential()
 {
     var implemntations = new List<IDecorationCommandImplementation>();
     foreach (var command in Commands)
     {
         var impl = new DecorationFactory().Get(command);
         impl.Execute();
     }
 }
Ejemplo n.º 2
0
        protected void Sequential()
        {
            var implemntations = new List <IDecorationCommandImplementation>();

            foreach (var command in Commands)
            {
                var impl = new DecorationFactory().Instantiate(command);
                impl.Execute();
            }
        }
Ejemplo n.º 3
0
 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()
         );
 }
Ejemplo n.º 4
0
        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()
            );
        }
Ejemplo n.º 5
0
        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);
            }
        }
Ejemplo n.º 6
0
 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);
     }
 }
Ejemplo n.º 7
0
 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);
     }
 }