示例#1
0
        public void picks_up_searchable_attribute_on_properties()
        {
            var mapping = DocumentMapping.For <Organization>();

            mapping.FieldFor(nameof(Organization.Name)).ShouldBeOfType <DuplicatedField>();
            SpecificationExtensions.ShouldNotBeOfType <DuplicatedField>(mapping.FieldFor(nameof(Organization.OtherProp)));
        }
示例#2
0
        public void duplicate_a_field()
        {
            var mapping = DocumentMapping.For <User>();

            mapping.DuplicateField(nameof(User.FirstName));

            mapping.FieldFor(nameof(User.FirstName)).ShouldBeOfType <DuplicatedField>();

            // other fields are still the same

            SpecificationExtensions.ShouldNotBeOfType <DuplicatedField>(mapping.FieldFor(nameof(User.LastName)));
        }