public void CopyToDocument()
        {
            mapper = new ReflectionDocumentBoostMapper<Sample>(typeof(Sample).GetProperty("Boost"));
            sample.Boost = 2f;

            mapper.CopyToDocument(sample, document);

            Assert.That(document.Boost, Is.EqualTo(2f));
        }
        public void CopyToDocument()
        {
            mapper       = new ReflectionDocumentBoostMapper <Sample>(typeof(Sample).GetProperty("Boost"));
            sample.Boost = 2f;

            mapper.CopyToDocument(sample, document);

            Assert.That(document.Boost, Is.EqualTo(2f));
        }
Exemple #3
0
        /// <summary>
        /// Defines a property that is used to set the document boost.
        /// </summary>
        public void DocumentBoost(Expression <Func <T, float> > expression)
        {
            var propInfo = GetMemberInfo <PropertyInfo>(expression.Body);

            docBoostMapper = new ReflectionDocumentBoostMapper <T>(propInfo);
        }