示例#1
0
        public void SetConexaoParaPostgreSql()
        {
            string connString = String.Format("Server={0};Port={1};User Id={2};Password={3};Database={4};"
                                              , LOCAL_HOST, PORTA_5432, USER, SENHA, JOKE_BD);

            JokeConfigurationBuilder.NewConfigurationToPostgreSQL()
            .Host(LOCAL_HOST)
            .Port(PORTA_5432)
            .Username(USER)
            .Password(SENHA)
            .DataBase(JOKE_BD)
            .BuildConfiguration();

            target = JokeConfiguration.Get();

            Assert.That(target.ConnectionString(), Is.EqualTo(connString));
        }
示例#2
0
 private DbConnection CreateDbConnection()
 {
     return((DbConnection)DbConnectionConstructor().
            Invoke(new object[] { JokeConfiguration.Get().ConnectionString() }));
 }
示例#3
0
 private ConstructorInfo DbConnectionConstructor()
 {
     return(JokeConfiguration.Get()
            .DbConnectionType()
            .GetConstructor(new[] { typeof(string) }));
 }
 private ConstructorInfo DbDataAdapterConstructor()
 {
     return(JokeConfiguration.Get()
            .DbDataAdapterType()
            .GetConstructor(new[] { typeof(string), connection.GetType() }));
 }