Example #1
0
        public void TestWithConnectionStringWithEquals()
        {
            DbConnectionProperties props = DbConnectionProperties.CreateFromString(
                @"connection-string=test1234&Username=US&Password=PW");

            Assert.AreEqual("test1234&Username=US&Password=PW", props.FullConnectionString);
            Assert.IsNull(props.Username);
            Assert.IsNull(props.Password);
            Assert.IsNull(props.Service);
            Assert.IsNull(props.DbName);
        }
Example #2
0
        public void TestWithSplitProperties()
        {
            DbConnectionProperties props = DbConnectionProperties.CreateFromString(
                @"service=testsvc
                  username=testuser
                  password=testpwd
                  database=testdb");

            Assert.IsNull(props.FullConnectionString);
            Assert.AreEqual("testuser", props.Username);
            Assert.AreEqual("testpwd", props.Password);
            Assert.AreEqual("testsvc", props.Service);
            Assert.AreEqual("testdb", props.DbName);
        }
Example #3
0
        public void TestCommentsAndEmptyLines()
        {
            DbConnectionProperties props = DbConnectionProperties.CreateFromString(
                @"service=testsvc

                  username=testuser
                  password=testpwd
                  #this is a comment
                  database=testdb
                ");

            Assert.IsNull(props.FullConnectionString);
            Assert.AreEqual("testuser", props.Username);
            Assert.AreEqual("testpwd", props.Password);
            Assert.AreEqual("testsvc", props.Service);
            Assert.AreEqual("testdb", props.DbName);
        }
Example #4
0
 public frmDataExport(string connStr, string dbName)
     : this(rsDb.GetDbObject(DbConnectionProperties.FromString(AdoProviderType.Auto, connStr)), dbName)
 {
 }