Пример #1
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);
            }
        }
Пример #2
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);
     }
 }
Пример #3
0
        private void ExecuteCleanup(CleanupXml cleanup, IDictionary <string, ITestVariable> allVariables)
        {
            var cleanupHelper = new SetupHelper(serviceLocator, allVariables);
            var commands      = cleanupHelper.Execute(cleanup.Commands);

            try
            {
                foreach (var command in commands)
                {
                    var impl = new DecorationFactory().Instantiate(command);
                    impl.Execute();
                }
            }
            catch (Exception ex)
            {
                HandleExceptionDuringCleanup(ex);
            }
        }
Пример #4
0
        private void ExecuteSetup(SetupXml setup, IDictionary <string, ITestVariable> allVariables)
        {
            var setupHelper = new SetupHelper(serviceLocator, allVariables);
            var commands    = setupHelper.Execute(setup.Commands);

            try
            {
                foreach (var command in 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().Instantiate(command);
                        impl.Execute();
                        if (command is IGroupCommand)
                        {
                            var groupCommand = (command as IGroupCommand);
                            groupCommand.HasRun = true;
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                HandleExceptionDuringSetup(ex);
            }
        }