Exemple #1
0
        public void Execute_ExistingSamplePackageWithParameter_SuccessAndParameterUsed()
        {
            var destPath = DiskOnFile.GetDirectoryPath() + "SampleFile.txt";
            if(File.Exists(destPath))
                File.Delete(destPath);

            var etl = new EtlXml();
            etl.Path = @"Etl\";
            etl.Name = "Sample.dtsx";
            etl.Password = "******";
            var param = new EtlParameterXml();
            param.Name="DestinationPath";
            param.StringValue = destPath;
            etl.InternalParameters.Add(param);

            var runner = new EtlFileRunner(etl);
            var result = runner.Run();

            Assert.That(result.IsSuccess, Is.True);
            Assert.That(File.Exists(destPath), Is.True);
        }
Exemple #2
0
        public void Execute_ExistingSamplePackageWithParameterWithInvalidValue_FailureWithMessage()
        {
            var destPath = DiskOnFile.GetDirectoryPath() + @"\/.txt";
            if (File.Exists(destPath))
                File.Delete(destPath);

            var etl = new EtlXml();
            etl.Path = @"Etl\";
            etl.Name = "Sample.dtsx";
            etl.Password = "******";
            var param = new EtlParameterXml();
            param.Name = "DestinationPath";
            param.StringValue = destPath;
            etl.InternalParameters.Add(param);

            var runner = new EtlFileRunner(etl);
            var result = runner.Run();

            Assert.That(result.IsSuccess, Is.False);
            Assert.That(result.Message, Is.StringContaining("invalid characters"));
        }
Exemple #3
0
        public void Execute_ExistingSamplePackage_Success()
        {
            var etl = Mock.Of<IEtl>( e =>
                e.Server == string.Empty
                && e.Path == @"Etl\"
                && e.Name == "Sample.dtsx"
                && e.Password=="p@ssw0rd"
                && e.Parameters == new List<EtlParameter>()
                );

            var runner = new EtlFileRunner(etl);
            var result = runner.Run();

            Assert.That(result.IsSuccess, Is.True);
        }