public ElasticClient Update(IndexName iname) { EsNode = new Uri("http://localhost:9200/"); EsConfig = new ConnectionSettings(EsNode).DefaultIndex(iname.ToString()); EsClient = new ElasticClient(EsConfig); return(EsClient); }
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()); }
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()); }