public override void SetUp() { base.SetUp(); RelationDefinition customerToOrder = FakeMappingConfiguration.Current.RelationDefinitions[ "Remotion.Data.DomainObjects.UnitTests.Mapping.TestDomain.Integration.Order:Remotion.Data.DomainObjects.UnitTests.Mapping.TestDomain." + "Integration.Order.Customer->Remotion.Data.DomainObjects.UnitTests.Mapping.TestDomain." + "Integration.Customer.Orders"]; _customerEndPoint = (VirtualRelationEndPointDefinition)customerToOrder.GetEndPointDefinition( "Customer", "Remotion.Data.DomainObjects.UnitTests.Mapping.TestDomain.Integration.Customer.Orders"); _orderEndPoint = (RelationEndPointDefinition)customerToOrder.GetEndPointDefinition( "Order", "Remotion.Data.DomainObjects.UnitTests.Mapping.TestDomain.Integration.Order.Customer"); }
private void CheckEndPointDefinitions(RelationDefinition expectedRelationDefinition, RelationDefinition actualRelationDefinition) { foreach (IRelationEndPointDefinition expectedEndPointDefinition in expectedRelationDefinition.EndPointDefinitions) { IRelationEndPointDefinition actualEndPointDefinition = actualRelationDefinition.GetEndPointDefinition( expectedEndPointDefinition.ClassDefinition.ID, expectedEndPointDefinition.PropertyName); Assert.IsNotNull( actualEndPointDefinition, "End point definition was not found (relation definition: '{0}', class: '{1}', property name: '{2}').", expectedRelationDefinition.ID, expectedEndPointDefinition.ClassDefinition.ID, expectedEndPointDefinition.PropertyName); var endPointDefinitionChecker = new RelationEndPointDefinitionChecker(); endPointDefinitionChecker.Check(expectedEndPointDefinition, actualEndPointDefinition, true); Assert.AreSame( actualRelationDefinition, actualEndPointDefinition.RelationDefinition, "End point definition does not reference the correct relation definition (relation definition: '{0}', class: '{1}', property name: '{2}').", actualRelationDefinition.ID, actualEndPointDefinition.ClassDefinition.ID, actualEndPointDefinition.PropertyName); } }
public void GetEndPointDefinition() { Assert.That(_customerToOrder.GetEndPointDefinition("Order", "Remotion.Data.DomainObjects.UnitTests.Mapping.TestDomain.Integration.Order.Customer"), Is.SameAs(_orderEndPoint)); Assert.That(_customerToOrder.GetEndPointDefinition( "Customer", "Remotion.Data.DomainObjects.UnitTests.Mapping.TestDomain.Integration.Customer.Orders"), Is.SameAs(_customerEndPoint)); }