public void TestEditIndexConfig() { using var configBuilder = new ConfigIndexBuilder(TempConfigDir); var config1 = new IndexConfig { IndexName = "ABC" }; var config2 = new IndexConfig { IndexName = "EFG" }; configBuilder.AddIndexConfig(config1); configBuilder.AddIndexConfig(config2); Assert.AreEqual(2, configBuilder.GetConfigs().Count()); config1.IndexName = "NEW"; configBuilder.EditIndexConfig(config1); CollectionAssert.AreEquivalent(new[] { "NEW", "EFG" }, configBuilder.GetConfigs().Select(u => u.IndexName)); config2.IndexName = "NEW NEW"; configBuilder.EditIndexConfig(config2); CollectionAssert.AreEquivalent(new[] { "NEW", "NEW NEW" }, configBuilder.GetConfigs().Select(u => u.IndexName)); }
public void TestAddIndexConfig() { using var configBuilder = new ConfigIndexBuilder(TempConfigDir); configBuilder.AddIndexConfig(new IndexConfig { IndexName = "ABC" }); Assert.AreEqual("ABC", configBuilder.GetConfigs().First().IndexName); configBuilder.AddIndexConfig(new IndexConfig { IndexName = "EFG" }); CollectionAssert.AreEquivalent(new[] { "ABC", "EFG" }, configBuilder.GetConfigs().Select(u => u.IndexName)); }
public void TestGetConfigs() { using var configBuilder = new ConfigIndexBuilder(TempConfigDir); configBuilder.AddIndexConfig(new IndexConfig { IndexName = "ABC" }); Assert.AreEqual("ABC", configBuilder.GetConfigs().First().IndexName); }
public void AddIndexConfig(IndexConfig indexConfig) { ConfigIndexBuilder.AddIndexConfig(indexConfig); }