예제 #1
0
        public void TestAddInt64Field_Stored()
        {
            Int64Field field  = null;
            long       value  = 123;
            var        stored = Field.Store.YES;

            AssertDocumentExtensionAddsToDocument(document => field = document.AddInt64Field("theName", value, stored));
            Assert.AreEqual("theName", field.Name);
            Assert.AreEqual(value, field.GetInt64ValueOrDefault());
            Assert.AreSame(Int64Field.TYPE_STORED, field.FieldType);
        }
예제 #2
0
        public void TestAddInt64Field_FieldType()
        {
            Int64Field field     = null;
            long       value     = 123;
            var        fieldType = new FieldType
            {
                IsIndexed    = true,
                IsTokenized  = true,
                OmitNorms    = false,
                IndexOptions = IndexOptions.DOCS_ONLY,
                NumericType  = NumericType.INT64,
                IsStored     = true
            }.Freeze();

            AssertDocumentExtensionAddsToDocument(document => field = document.AddInt64Field("theName", value, fieldType));
            Assert.AreEqual("theName", field.Name);
            Assert.AreEqual(value, field.GetInt64ValueOrDefault());
            Assert.AreSame(fieldType, field.FieldType);
        }