public void TestDeleteIndexConfig()
        {
            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());

            configBuilder.DeleteIndexConfig(config2.Pk);
            CollectionAssert.AreEquivalent(new[] { "ABC" }, configBuilder.GetConfigs().Select(u => u.IndexName));

            configBuilder.DeleteIndexConfig(config1.Pk);
            Assert.AreEqual(0, configBuilder.GetConfigs().Count());
        }
示例#2
0
 public void DeleteIndexConfig(Guid pk)
 {
     ConfigIndexBuilder.DeleteIndexConfig(pk);
 }