public Database ( String dbname ) : Database | ||
dbname | String | name of database to access |
return | Database |
public void Setup() { DBName = TestConstants.defaultDatabaseName + DateTime.Now.Ticks; client = new CloudantClientBuilder(TestConstants.account) { username = TestConstants.username, password = TestConstants.password }.GetResult(); // create the database try { db = client.Database(DBName); db.EnsureExistsAsync().Wait(); Assert.NotNull(db); } catch (AggregateException ae) { Assert.Fail("Create remote database failed. Cause: " + ae.Message); } catch (Exception e) { Assert.Fail("Unexpected failure: " + e.Message); } }
public void testBasicAuthInterceptor() { BasicAuthenticationInterceptor basicAuthInterceptor = new BasicAuthenticationInterceptor(TestConstants.username, TestConstants.password); client = new CloudantClientBuilder(TestConstants.account) { interceptors = new List<IHttpConnectionInterceptor>(){ basicAuthInterceptor } }.GetResult(); db = client.Database(DBName); Assert.DoesNotThrow(async () => { await db.EnsureExistsAsync().ConfigureAwait(continueOnCapturedContext: false); }, "Exception thrown while creating database using BasicAuth interceptor. "); Assert.NotNull(db); }
public void setup() { client = new CloudantClientBuilder(TestConstants.account) { username = TestConstants.username, password = TestConstants.password }.GetResult(); string DBName = "httphelpertests" + DateTime.Now.Ticks; db = client.Database(DBName); db.EnsureExistsAsync().Wait(); }