Example #1
0
        public void InMemoryDatabaseGenerator_IndexField_DefaultFlags()
        {
            var field = new IndexField("FieldName", "value", IndexingMode.Analyzed, IndexStoringMode.No,
                                       IndexTermVector.No);

            Assert.AreEqual("FieldName:value:S", field.ToString());

            var parsed = IndexField.Parse(field.ToString(), false);

            Assert.AreEqual(field.Name, parsed.Name);
            Assert.AreEqual(field.Type, parsed.Type);
            Assert.AreEqual(field.ValueAsString, parsed.ValueAsString);
            Assert.AreEqual(IndexingMode.Default, parsed.Mode);
            Assert.AreEqual(IndexStoringMode.Default, parsed.Store);
            Assert.AreEqual(IndexTermVector.Default, parsed.TermVector);
        }
Example #2
0
        public void InMemoryDatabaseGenerator_IndexField_AllFlags_Stored()
        {
            var field = new IndexField("FieldName", "value", IndexingMode.No, IndexStoringMode.Yes,
                                       IndexTermVector.WithPositions);

            Assert.AreEqual("IM3,TV3,FieldName:value:S", field.ToString(true));

            var parsed = IndexField.Parse(field.ToString(), true);

            Assert.AreEqual(field.Name, parsed.Name);
            Assert.AreEqual(field.Type, parsed.Type);
            Assert.AreEqual(field.ValueAsString, parsed.ValueAsString);
            Assert.AreEqual(field.Mode, parsed.Mode);
            Assert.AreEqual(field.Store, parsed.Store);
            Assert.AreEqual(field.TermVector, parsed.TermVector);
        }