public void Should_start_postgres_process()
        {
            var runtimeConfig  = new DefaultRuntimeConfig();
            var postgresConfig = new DefaultPgConfig(new Distribution.Distribution(new Version("9.3.20")), "data");
            var process        = new PostgresProcess(postgresConfig, runtimeConfig);

            process.Start();
        }
Exemple #2
0
        public string Start(IRuntimeConfig runtimeConfig,
                            int port, string dbName,
                            string user, string password,
                            IReadOnlyCollection <string> additionalParams)
        {
            var newConfig = new PostgresConfig(config.Distribution,
                                               port,
                                               dbName, config.DataDir,
                                               user, password, additionalParams);

            process = new PostgresProcess(newConfig, runtimeConfig);
            process.Start();

            return(newConfig.ToConnectionString());
        }
        public void Should_be_able_to_connect_to_db_using_db_provider()
        {
            var runtimeConfig  = new DefaultRuntimeConfig();
            var postgresConfig = new DefaultPgConfig(new Distribution.Distribution(new Version("9.3.20")), "data");
            var process        = new PostgresProcess(postgresConfig, runtimeConfig);

            process.Start();

            using (var conn = new NpgsqlConnection(postgresConfig.ToConnectionString()))
            {
                conn.Open();

                conn.State.Should().Be(ConnectionState.Open);
            }
        }