internal static IMyCouchServerClient CreateServerClient() { var config = Environment; var uriBuilder = new MyCouchUriBuilder(config.ServerUrl); if (config.HasCredentials()) uriBuilder.SetBasicCredentials(config.User, config.Password); return config.IsAgainstCloudant() ? (IMyCouchServerClient)new MyCouchCloudantServerClient(new CustomCloudantServerClientConnection(uriBuilder.Build())) : (IMyCouchServerClient)new MyCouchServerClient(uriBuilder.Build()); }
private static IMyCouchClient CreateDbClient(string dbName) { var config = Environment; var uriBuilder = new MyCouchUriBuilder(config.ServerUrl) .SetDbName(dbName); if (config.HasCredentials()) uriBuilder.SetBasicCredentials(config.User, config.Password); return config.IsAgainstCloudant() ? new MyCouchCloudantClient(new CustomCloudantDbClientConnection(uriBuilder.Build())) : new MyCouchClient(uriBuilder.Build()); }
private static IMyCouchClient CreateDbClient(string dbName) { var config = Environment; var uriBuilder = new MyCouchUriBuilder(config.ServerUrl) .SetDbName(dbName); if (config.HasCredentials()) { uriBuilder.SetBasicCredentials(config.User, config.Password); } return(config.IsAgainstCloudant() ? new MyCouchCloudantClient(new CustomCloudantDbClientConnection(uriBuilder.Build())) : new MyCouchClient(uriBuilder.Build())); }
internal static IMyCouchClient CreateNormalClient() { if (NormalClientEnvironment == null) { throw new Exception("Can not create Normal client. Missing configuration."); } var cfg = NormalClientEnvironment.Client; var uriBuilder = new MyCouchUriBuilder(cfg.ServerUrl) .SetDbName(cfg.DbName) .SetBasicCredentials(cfg.User, cfg.Password); return(cfg.IsAgainstCloudant ? new MyCouchClient(new CustomCloudantConnection(uriBuilder.Build())) : new MyCouchClient(uriBuilder.Build())); }
internal static ICloudantClient CreateCloudantClient() { if (NormalEnvironment == null) throw new Exception("Can not create client for Cloudant tests. Missing configuration."); var cfg = CloudantEnvironment.Client; var uriBuilder = new MyCouchUriBuilder(cfg.ServerUrl) .SetDbName(NormalEnvironment.Client.DbName) .SetBasicCredentials(cfg.User, cfg.Password); return new CloudantClient(uriBuilder.Build()); }
internal static IClient CreateClient() { #if !NETFX_CORE var url = ConnectionString.Get("mycouchtests"); #else var url = "http://*****:*****@ssword"); return new Client(uriBuilder.Build()); }
internal static IClient CreateClient() { #if !NETFX_CORE var url = ConnectionString.Get("mycouchtests"); #else var url = "http://*****:*****@ssword"); return(new Client(uriBuilder.Build())); }
internal static IMyCouchServerClient CreateServerClient() { var config = Environment; var uriBuilder = new MyCouchUriBuilder(config.ServerUrl); if (config.HasCredentials()) { uriBuilder.SetBasicCredentials(config.User, config.Password); } return(config.IsAgainstCloudant() ? (IMyCouchServerClient) new MyCouchCloudantServerClient(new CustomCloudantServerClientConnection(uriBuilder.Build())) : (IMyCouchServerClient) new MyCouchServerClient(uriBuilder.Build())); }