Exemplo n.º 1
0
        public void IndexWithSubPropertyReturnAs_Property_SubProperty()
        {
            var index = new ContactIndex
            {
                Conventions = new DocumentConvention()
            };
            var indexDefinition = index.CreateIndexDefinition();

            Assert.True(indexDefinition.Stores.ContainsKey("PrimaryEmail_Email"));
            Assert.True(indexDefinition.Indexes.ContainsKey("PrimaryEmail_Email"));
            Assert.True(indexDefinition.Analyzers.ContainsKey("PrimaryEmail_Email"));
            Assert.True(indexDefinition.Stores.ContainsKey("String_Store"));
            Assert.True(indexDefinition.Indexes.ContainsKey("String_Index"));
            Assert.True(indexDefinition.Analyzers.ContainsKey("String_Analyzer"));
        }
Exemplo n.º 2
0
        public void IndexWithSubPropertyReturnAs_Property_SubPropery()
        {
            using (var store = new DocumentStore
            {
                Url = "http://localhost:8079"
            }.Initialize())
            {
                store.OpenSession();
                var index = new ContactIndex
                {
                    Conventions = new DocumentConvention()
                };

                var result = index.CreateIndexDefinition();

                Assert.True(result.Stores.ContainsKey("PrimaryEmail_Email"));
                Assert.True(result.Indexes.ContainsKey("PrimaryEmail_Email"));
                Assert.True(result.Analyzers.ContainsKey("PrimaryEmail_Email"));
                Assert.True(result.Stores.ContainsKey("String_Store"));
                Assert.True(result.Indexes.ContainsKey("String_Index"));
                Assert.True(result.Analyzers.ContainsKey("String_Analyzer"));
            }
        }