public void ShouldWriteManyToOnes() { var mapping = new JoinedSubclassMapping(); mapping.AddReference(new ManyToOneMapping()); writer.VerifyXml(mapping) .Element("many-to-one").Exists(); }
ISubclassMapping ISubclassMappingProvider.GetSubclassMapping() { var mapping = new JoinedSubclassMapping(attributes.CloneInner()); mapping.Key = new KeyMapping { ContainingEntityType = typeof(TSubclass) }; mapping.Name = typeof(TSubclass).AssemblyQualifiedName; mapping.Type = typeof(TSubclass); foreach (var column in columns) { mapping.Key.AddColumn(column); } foreach (var property in properties) { mapping.AddProperty(property.GetPropertyMapping()); } foreach (var component in components) { mapping.AddComponent(component.GetComponentMapping()); } foreach (var oneToOne in oneToOnes) { mapping.AddOneToOne(oneToOne.GetOneToOneMapping()); } foreach (var collection in collections) { mapping.AddCollection(collection.GetCollectionMapping()); } foreach (var reference in references) { mapping.AddReference(reference.GetManyToOneMapping()); } foreach (var any in anys) { mapping.AddAny(any.GetAnyMapping()); } return(mapping); }
public void ReferencesCollectionHasSameCountAsMapping() { mapping.AddReference(new ManyToOneMapping()); inspector.References.Count().ShouldEqual(1); }