Example #1
0
        /// <summary>
        /// Executes demo live tests.
        /// </summary>
        internal static void RunLiveTests8()
        {
            // set package execution parameters eg. variables, connections
            var parameters = new ExecutionParameters();

            // add variables and their values to be set when the package has been loaded
            parameters.AddVariable(@"\[Parent].[ConvertDestinationPath]", Constants.CustomersFileConverted);
            parameters.AddVariable(@"\[Parent].[DestinationPath]", Constants.CustomersFileDestination);
            parameters.AddVariable(@"\[Parent].[SourcePath]", Constants.CustomersFileSource);
            parameters.AddVariable(@"\[Parent].[PathToChildPackage]", Constants.PathToCopyCustomersPackage);

            // create engine for live testing
            var engine = EngineFactory.GetClassInstance <ILiveTestEngine>();

            // load packages and relate them to the logical group - repository
            const string repositoryName = "DEMO6";

            int cnt = engine.LoadPackages(repositoryName, Constants.PathToPackages);

            // load live tests from the current assembly
            engine.LoadRepositoryActions(repositoryName);

            // set execution parameters
            engine.SetExecutionParameters(parameters);

            // execute the package and attach live tests
            engine.ExecuteLiveTestsWithGui(repositoryName, "Parent.dtsx");
        }
Example #2
0
        /// <summary>
        /// Executes demo live tests with main package that has a parameter.
        /// </summary>
        internal static void RunLiveTests4()
        {
            // set package execution parameters eg. variables, connections
            var parameters = new ExecutionParameters();

            // add variables and their values to be set when the package has been loaded
            parameters.AddVariable(@"\[MainWithParameter].[ConnectionString]", Constants.SsisDbConnectionString);
            parameters.AddVariable(@"\[MainWithParameter].[CopyCustomersPath]", Constants.PathToCopyCustomersPackage);
            parameters.AddVariable(@"\[MainWithParameter].[LoadCustomersPath]", Constants.PathToLoadCustomersPackage);
            parameters.AddVariable(@"\[MainWithParameter].[ConvertDestinationPath]", Constants.CustomersFileConverted);
            parameters.AddVariable(@"\[MainWithParameter].[DestinationPath]", Constants.CustomersFileDestination);

            // add  package parameters
            parameters.AddPackageParameter(@"SourcePath", Constants.CustomersFileSource);

            // create engine for live testing
            var engine = EngineFactory.GetClassInstance <ILiveTestEngine>();

            // load packages and relate them to the logical group - repository
            engine.LoadPackages("DEMO", Constants.PathToPackages);

            // load live tests from the current assembly
            engine.LoadRepositoryActions("DEMO");

            // set execution parameters
            engine.SetExecutionParameters(parameters);

            // execute the package and attach live tests
            engine.ExecuteLiveTestsWithGui("DEMO", "MainWithParameter.dtsx");
        }