Exemplo n.º 1
0
        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));
        }
Exemplo n.º 2
0
        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));
        }
Exemplo n.º 3
0
        public void TestGetConfigs()
        {
            using var configBuilder = new ConfigIndexBuilder(TempConfigDir);
            configBuilder.AddIndexConfig(new IndexConfig
            {
                IndexName = "ABC"
            });

            Assert.AreEqual("ABC", configBuilder.GetConfigs().First().IndexName);
        }
Exemplo n.º 4
0
 public void AddIndexConfig(IndexConfig indexConfig)
 {
     ConfigIndexBuilder.AddIndexConfig(indexConfig);
 }