Ejemplo n.º 1
0
        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());
        }
Ejemplo n.º 2
0
        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());
        }
Ejemplo n.º 3
0
        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()));
        }
Ejemplo n.º 4
0
        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()));
        }
Ejemplo n.º 5
0
        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());
        }
Ejemplo n.º 6
0
        internal static IClient CreateClient()
        {
#if !NETFX_CORE
            var url = ConnectionString.Get("mycouchtests");
#else
            var url = "http://*****:*****@ssword");

            return new Client(uriBuilder.Build());
        }
Ejemplo n.º 7
0
        internal static IClient CreateClient()
        {
#if !NETFX_CORE
            var url = ConnectionString.Get("mycouchtests");
#else
            var url = "http://*****:*****@ssword");

            return(new Client(uriBuilder.Build()));
        }
Ejemplo n.º 8
0
        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()));
        }