public void ShouldWriteColumns()
        {
            var container = new XmlWriterContainer();
            var mapping = new ManyToManyMapping();

            mapping.AddColumn(new ColumnMapping { Name = "Column1" });

            writer = container.Resolve<IXmlWriter<ManyToManyMapping>>();
            writer.VerifyXml(mapping)
                .Element("column").Exists();
        }
        private static ICollectionRelationshipMapping CreateManyToMany(Member member, Type parentType, Type childType)
        {
            var ColumnMapping = new ColumnMapping();
            ColumnMapping.Set(x => x.Name, Layer.Defaults, "Id_" + childType.Name);

            var Mapping = new ManyToManyMapping {ContainingEntityType = parentType};
            Mapping.Set(x => x.Class, Layer.Defaults, new FluentNHibernate.MappingModel.TypeReference(childType));
            Mapping.Set(x => x.ParentType, Layer.Defaults, parentType);
            Mapping.Set(x => x.ChildType, Layer.Defaults, childType);
            Mapping.AddColumn(Layer.Defaults, ColumnMapping);

            return Mapping;
        }
        static ICollectionRelationshipMapping CreateManyToMany(Member property, Type child, Type parent)
        {
            var mapping = new ManyToManyMapping
            {
                ContainingEntityType = parent
            };
            mapping.Set(x => x.Class, Layer.Defaults, new TypeReference(property.PropertyType.GetGenericArguments()[0]));

            var columnMapping = new ColumnMapping();
            columnMapping.Set(x => x.Name, Layer.Defaults, child.Name + "_id");
            mapping.AddColumn(Layer.Defaults, columnMapping);

            return mapping;
        }
        static ICollectionRelationshipMapping CreateManyToMany(Member member, Type parentType, Type childType)
        {
            var columnMapping = new ColumnMapping();
            columnMapping.Set(x => x.Name, Layer.Defaults, childType.Name + "Id");

            var mapping = new ManyToManyMapping { ContainingEntityType = parentType };
            mapping.Set(x => x.Class, Layer.Defaults, new TypeReference(childType));
            mapping.Set(x => x.ParentType, Layer.Defaults, parentType);
            mapping.Set(x => x.ChildType, Layer.Defaults, childType);
            mapping.AddColumn(Layer.Defaults, columnMapping);

            return mapping;
        }