Ejemplo n.º 1
0
        public Test(SsisTestSuite testSuite, string name, string project, string package, string password, string task, DTSExecResult taskResult)
        {
            Asserts         = new Asserts(_context, this);
            TestSuite       = testSuite;
            Name            = name;
            Task            = task;
            PackageLocation = package;

            if (password != null)
            {
                _securePassword = Helper.ConvertToSecureString(password);
            }

            ProjectLocation = project;
            TestSetup       = new CommandSet(string.IsNullOrEmpty(Name) ? "Setup" : Name + " Setup", TestSuite);
            TestTeardown    = new CommandSet(string.IsNullOrEmpty(Name) ? "Teardown" : Name + " Teardown", TestSuite);
            TaskResult      = taskResult;
        }
Ejemplo n.º 2
0
        private void ExecuteCommandSet(CommandSet commandSet)
        {
            if (commandSet == null)
            {
                throw new ArgumentNullException("commandSet");
            }

            try
            {
                commandSet.CommandStarted   += OnRaiseCommandStarted;
                commandSet.CommandCompleted += OnRaiseCommandCompleted;
                commandSet.CommandFailed    += OnRaiseCommandFailed;

                commandSet.Execute();
            }
            finally
            {
                commandSet.CommandStarted   -= OnRaiseCommandStarted;
                commandSet.CommandCompleted -= OnRaiseCommandCompleted;
                commandSet.CommandFailed    -= OnRaiseCommandFailed;
            }
        }