Beispiel #1
0
            protected override void Arrange()
            {
                _options = new DeployDatabase
                {
                    Engine           = EngineType.PostgreSql,
                    DatabaseType     = DatabaseType.ODS,
                    ConnectionString = "Valid Connection String"
                };

                _databaseCommand = Stub <IDatabaseCommand>();

                A.CallTo(() => _databaseCommand.Execute(A <IOptions> ._))
                .Throws(new Exception());

                _databaseCommandFactory = Stub <IDatabaseCommandFactory>();

                A.CallTo(() => _databaseCommandFactory.CreateDatabaseCommands(A <EngineType> ._))
                .Returns(new List <IDatabaseCommand> {
                    _databaseCommand
                });

                _compositeSpecification = Stub <ICompositeSpecification>();

                A.CallTo(() => _compositeSpecification.IsSatisfiedBy(A <object> ._))
                .Returns(true);

                var compositeSpecifications = new List <ICompositeSpecification> {
                    _compositeSpecification
                };

                _result = -99;

                _sut = new ApplicationRunner(_options, _databaseCommandFactory, compositeSpecifications);
            }
Beispiel #2
0
 public DeployServerForm()
 {
     InitializeComponent();
     DisableControls();
     Async(() =>
     {
         try
         {
             this.deployDatabase = new DeployDatabase(false);
             this.deployment     = this.deployDatabase.GetDeployment();
             this.deployment.InitializeIfNotExists();
             if (!File.Exists(this.ServiceConfigurationFile))
             {
                 this.deployment.Download();
             }
             Sync(() =>
             {
                 ReloadServiceConfiguration();
                 EnableControls();
                 UpdateData();
                 timerUpdate.Enabled = true;
             });
         }
         catch (Exception ex)
         {
             Sync(() =>
             {
                 MessageBox.Show(ex.Message, this.Text, MessageBoxButtons.OK, MessageBoxIcon.Error);
             });
         }
     });
 }
 public void CanDeployDatabase()
 {
     DeployDatabase deploy = new DeployDatabase();
     deploy.ConfigFilePath = @"C:\prj\Customer - CTA\Trunk\Construction\Database\DeployDatabase.xml";
     deploy.ScriptsDirectory = @"C:\prj\Customer - CTA\Trunk\Construction\Database\alter";
     var result = deploy.Execute();
     Assert.IsTrue(result);
 }
Beispiel #4
0
        public void CanDeployDatabase()
        {
            DeployDatabase deploy = new DeployDatabase();

            deploy.ConfigFilePath   = @"C:\prj\Customer - CTA\Trunk\Construction\Database\DeployDatabase.xml";
            deploy.ScriptsDirectory = @"C:\prj\Customer - CTA\Trunk\Construction\Database\alter";
            var result = deploy.Execute();

            Assert.IsTrue(result);
        }
Beispiel #5
0
 public DeployClientForm()
 {
     InitializeComponent();
     AsyncUpdate(() => this.deployDatabase = new DeployDatabase(true));
 }