public void UseCorrectDefaultValues()
        {
            // Arrange
              CouchDbConnectionStringBuilder builder =
            new CouchDbConnectionStringBuilder(String.Empty);

              // Assert
              Assert.AreEqual("localhost", builder.Host);
              Assert.AreEqual(String.Empty, builder.Username);
              Assert.AreEqual(5984, builder.Port);
              Assert.AreEqual(String.Empty, builder.Password);
              Assert.AreEqual(false, builder.SslEnabled);
        }
Esempio n. 2
0
        protected CouchBase(string connectionStringName)
        {
            ConnectionStringSettings connectionString =
            ConfigurationManager.ConnectionStrings[connectionStringName];
              if (connectionString == null)
            throw new ArgumentException("Invalid connection string name");

              CouchDbConnectionStringBuilder cs = new CouchDbConnectionStringBuilder(
            connectionString.ConnectionString);

              BasePlug = Plug.New(String.Format("{0}://{1}:{2}",
            cs.SslEnabled ? "https" : "http", cs.Host, cs.Port)).WithCredentials(
            cs.Username, cs.Password);
        }
        public void ParseConnectionString()
        {
            // Arrange
              CouchDbConnectionStringBuilder builder =
            new CouchDbConnectionStringBuilder(
              "Host=test;port=10;username=un;Password=coucou;SslEnabled=true");

              // Assert
              Assert.AreEqual("test", builder.Host);
              Assert.AreEqual("un", builder.Username);
              Assert.AreEqual(10, builder.Port);
              Assert.AreEqual("coucou", builder.Password);
              Assert.AreEqual(true, builder.SslEnabled);
        }