Пример #1
0
 public ElasticClient Update(IndexName iname)
 {
     EsNode   = new Uri("http://localhost:9200/");
     EsConfig = new ConnectionSettings(EsNode).DefaultIndex(iname.ToString());
     EsClient = new ElasticClient(EsConfig);
     return(EsClient);
 }
Пример #2
0
        public void ShouldReturnIndexConstraintName()
        {
            var schemaName = "schemaName";
            var tableName  = "tableName";

            string[] columnName = new string[] { "column1", "column2" };

            var cons = new IndexName(schemaName, tableName, columnName, false);
            var expectedConstraintString = "IX_schemaName_tableName_column1_column2";

            Assert.AreEqual(expectedConstraintString, cons.ToString());
        }
Пример #3
0
        public void ShouldReturnUniqueIndexConstraintNameInDboSchema()
        {
            var schemaName = "dbo";
            var tableName  = "tableName";

            string[] columnName = new string[] { "column1", "column2" };

            var cons = new IndexName(schemaName, tableName, columnName, true);
            var expectedConstraintString = "UIX_tableName_column1_column2";

            Assert.AreEqual(expectedConstraintString, cons.ToString());
        }