Ejemplo n.º 1
0
        protected override void Setup(SetupContext context)
        {
            DtsParameter param = context.Package.GetParameter("SourcePath");
            object       val   = param.GetValue();

            param.SetValue(Constants.CustomersFileSource);

            DtsVariable var1 = context.Package.GetVariable("DestinationPath");

            var1.SetValue(Constants.CustomersFileDestination);

            DtsVariable var2 = context.Package.GetVariable("ConvertDestinationPath");

            var2.SetValue(Constants.CustomersFileConverted);

            DtsVariable var3 = context.Package.GetVariable("CopyCustomersPath");

            var3.SetValue(Constants.PathToCopyCustomersPackage);

            DtsVariable var4 = context.Package.GetVariable("LoadCustomersPath");

            var4.SetValue(Constants.PathToLoadCustomersPackage);

            DtsVariable var5 = context.Package.GetVariable("ConnectionString");

            var5.SetValue(Constants.SsisDbConnectionString);
        }
Ejemplo n.º 2
0
        protected override void Verify(VerificationContext context)
        {
            var          conn  = context.Package.GetConnection("Customers Src");
            DtsParameter param = context.Package.GetParameter("SourcePath");
            object       val   = param.GetValue();

            Assert.IsTrue(File.Exists(Constants.CustomersFileDestination));

            context.DataAccess.OpenConnection(Constants.DbConnectionString);
            var rowCount = (int)context.DataAccess.ExecuteScalar(@"select count(*) from [dbo].[CustomersStaging]");

            context.DataAccess.CloseConnection();

            Assert.AreEqual(3, rowCount);
        }
Ejemplo n.º 3
0
        protected override void Setup(SetupContext context)
        {
            DtsParameter custSrcParam = context.Package.Project.GetParameter(@"SourcePath");

            custSrcParam.SetValue(Constants.CustomersFileSource);

            DtsParameter custDesParam = context.Package.Project.GetParameter(@"DestinationPath");

            custDesParam.SetValue(Constants.CustomersFileDestination);

            DtsParameter custDesConvertedParam = context.Package.Project.GetParameter(@"ConvertDestinationPath");

            custDesConvertedParam.SetValue(Constants.CustomersFileConverted);

            DtsVariable variable = context.Package.GetVariableForPath(@"\[CopyCustomers]\[DFT Convert customer names].[CustomerCount]");

            variable.SetValue(0);
        }