Ejemplo n.º 1
0
        public ColumnItemsView(AppConfig appConfig, WorkbookPropertiesConfig workbookPropertiesConfig, ISqlCreatorView parentForm)
        {
            InitializeComponent();
            _appConfig = appConfig;
            _workbookPropertiesConfig = workbookPropertiesConfig;
            _parentForm = parentForm;
            IColumnItemsPresenter presenter = new ColumnItemsPresenter(
                this,
                parentForm.SelectedCriteria.Column,
                parentForm.AvailableTablesText,
                new DatabaseConnectionFactory().CreateDbConnection(appConfig.DatabaseType, appConfig.ConnectionString),
                new SqlGeneratorFactory().CreateSqlGenerator(appConfig.DatabaseType));

            presenter.Initialize();

            // Makes first item in drop down box the selected item, so that blank choice disappears and "" will not be passed to presenter for limit.
            cbox_paging_limit.SelectedIndex = 0;
            //SelectedItems.AllowNew = true;
        }
        public void run_before_each_test_method()
        {
            User user = new User("username", "password", false);

            appConfig = new AppConfig("fake connection string", "sql", DatabaseType.PostgreSQL);
            //appConfig.User.Username = "******";
            //appConfig.Password = "******";
            //appConfig.ConnectionString = "fake connection string";
            //appConfig.DatabaseType = DatabaseType.PostgreSQL;

            workbookPropertiesConfig = new WorkbookPropertiesConfig();

            view           = MockRepository.GenerateMock <ISqlCreatorView>();
            view.AppConfig = appConfig;
            view.WorkbookPropertiesConfig = workbookPropertiesConfig;

            dbConnection = MockRepository.GenerateStub <IDatabaseConnection>();

            sqlGenerator = MockRepository.GenerateStub <BaseSqlGenerator>();

            presenter = new SqlCreatorPresenter(view, dbConnection, sqlGenerator);
        }
Ejemplo n.º 3
0
 public SqlCreatorPresenter(ISqlCreatorView view, IDatabaseConnection dbConnection, BaseSqlGenerator sqlGenerator)
 {
     _view             = view;
     this.dbConnection = dbConnection;
     this.sqlGenerator = sqlGenerator;
 }