public void ShouldWriteManyToOnes()
        {
            var mapping = new CompositeIndexMapping();
            mapping.AddReference(new KeyManyToOneMapping());

            writer.VerifyXml(mapping)
                .Element("key-many-to-one").Exists();
        }
        public void ShouldWriteManyToOnes()
        {
            var mapping = new CompositeIndexMapping();

            mapping.AddReference(new KeyManyToOneMapping());

            writer.VerifyXml(mapping)
            .Element("key-many-to-one").Exists();
        }
        KeyManyToOnePart Reference(Member property, IEnumerable <string> columnNames)
        {
            var reference = new KeyManyToOneMapping
            {
                Name  = property.Name,
                Class = new TypeReference(property.PropertyType),
                ContainingEntityType = typeof(T)
            };

            foreach (var column in columnNames)
            {
                reference.AddColumn(new ColumnMapping {
                    Name = column
                });
            }

            var keyPart = new KeyManyToOnePart(reference);

            mapping.AddReference(reference);

            return(new KeyManyToOnePart(reference));
        }