public Type GetPropertyType(PropertyDefinition propertyDefinition, IRelationEndPointDefinition relationEndPointDefinition) { ArgumentUtility.CheckNotNull("relationEndPointDefinition", relationEndPointDefinition); Assertion.IsFalse(relationEndPointDefinition.IsAnonymous); return(relationEndPointDefinition.PropertyInfo.PropertyType); }
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 RaiseRelationReadEvent( DomainObject domainObject, IRelationEndPointDefinition relationEndPointDefinition, ReadOnlyDomainObjectCollectionAdapter <DomainObject> relatedObjects, ValueAccess valueAccess) { }
private MappingValidationResult Validate(IRelationEndPointDefinition relationEndPointDefinition) { ArgumentUtility.CheckNotNull("relationEndPointDefinition", relationEndPointDefinition); var endPointDefinitionAsVirtualRelationEndPointDefinition = relationEndPointDefinition as VirtualRelationEndPointDefinition; if (endPointDefinitionAsVirtualRelationEndPointDefinition != null) { if (endPointDefinitionAsVirtualRelationEndPointDefinition.Cardinality == CardinalityType.One && !ReflectionUtility.IsDomainObject(endPointDefinitionAsVirtualRelationEndPointDefinition.PropertyInfo.PropertyType)) { return(MappingValidationResult.CreateInvalidResultForProperty( endPointDefinitionAsVirtualRelationEndPointDefinition.PropertyInfo, "The property type of a virtual end point of a one-to-one relation must be assignable to '{0}'.", typeof(DomainObject).Name)); } if (endPointDefinitionAsVirtualRelationEndPointDefinition.Cardinality == CardinalityType.Many && !ReflectionUtility.IsObjectList(endPointDefinitionAsVirtualRelationEndPointDefinition.PropertyInfo.PropertyType)) { return(MappingValidationResult.CreateInvalidResultForProperty( endPointDefinitionAsVirtualRelationEndPointDefinition.PropertyInfo, "The property type of a virtual end point of a one-to-many relation must be assignable to '{0}'.", typeof(ObjectList <>).Name)); } } return(MappingValidationResult.CreateValidResult()); }
private void RegisterEndPointData( IRelationEndPointDefinition relationEndPointDefinition, IEnumerable <ILoadedObjectData> originatingObjects, ILookup <ObjectID, ILoadedObjectData> groupedRelatedObjects) { var relatedObjectsByOriginalObject = groupedRelatedObjects; foreach (var originatingObject in originatingObjects) { if (!originatingObject.IsNull && originatingObject.ObjectID.ClassDefinition.IsRelationEndPoint(relationEndPointDefinition)) { var relationEndPointID = RelationEndPointID.Create(originatingObject.ObjectID, relationEndPointDefinition); var relatedObjectData = relatedObjectsByOriginalObject[originatingObject.ObjectID]; var relatedObjects = relatedObjectData.Select(data => data.GetDomainObjectReference()).ToArray(); if (relationEndPointDefinition.IsMandatory && relatedObjects.Length == 0) { var message = string.Format( "The fetched mandatory collection property '{0}' on object '{1}' contains no items.", relationEndPointDefinition.PropertyName, relationEndPointID.ObjectID); throw new InvalidOperationException(message); } if (!TrySetCollectionEndPointData(relationEndPointID, relatedObjects)) { s_log.DebugFormat("Relation data for relation end-point '{0}' is discarded; the end-point has already been loaded.", relationEndPointID); } } } }
public virtual void RelationReading( ClientTransaction clientTransaction, DomainObject domainObject, IRelationEndPointDefinition relationEndPointDefinition, ValueAccess valueAccess) { }
public override void SetUp() { base.SetUp(); _mockRepository = new MockRepository(); _persistenceStrategyMock = _mockRepository.StrictMock <IFetchEnabledPersistenceStrategy> (); _loadedObjectDataRegistrationAgentMock = _mockRepository.StrictMock <ILoadedObjectDataRegistrationAgent> (); _loadedObjectDataProviderStub = _mockRepository.Stub <ILoadedObjectDataProvider> (); _eagerFetcherMock = _mockRepository.StrictMock <IEagerFetcher> (); _fetchEnabledObjectLoader = new FetchEnabledObjectLoader( _persistenceStrategyMock, _loadedObjectDataRegistrationAgentMock, _loadedObjectDataProviderStub, _eagerFetcherMock); _resultItem1 = LoadedObjectDataObjectMother.CreateLoadedObjectDataStub(DomainObjectIDs.Order1); _resultItem2 = LoadedObjectDataObjectMother.CreateLoadedObjectDataStub(DomainObjectIDs.Order3); _resultItemWithSourceData1 = LoadedObjectDataObjectMother.CreateLoadedObjectDataWithDataSourceData(DomainObjectIDs.Order1); _resultItemWithSourceData2 = LoadedObjectDataObjectMother.CreateLoadedObjectDataWithDataSourceData(DomainObjectIDs.Order3); _orderTicketEndPointDefinition = GetEndPointDefinition(typeof(Order), "OrderTicket"); _customerEndPointDefinition = GetEndPointDefinition(typeof(Order), "Customer"); var fetchQuery1 = CreateFakeQuery(); var fetchQuery2 = CreateFakeQuery(); _queryWithFetchQueries = CreateFakeQuery( Tuple.Create(_orderTicketEndPointDefinition, fetchQuery1), Tuple.Create(_customerEndPointDefinition, fetchQuery2)); }
private void ExpectRelationReadEvents( ClientTransaction clientTransaction, DomainObject domainObject, IRelationEndPointDefinition endPointDefinition, DomainObject[] relatedDomainObjects) { using (ListenerDynamicMock.GetMockRepository().Ordered()) { ListenerDynamicMock.Expect(mock => mock.RelationReading(clientTransaction, domainObject, endPointDefinition, ValueAccess.Current)); ListenerDynamicMock.Expect( mock => mock.RelationRead( Arg.Is(clientTransaction), Arg.Is(domainObject), Arg.Is(endPointDefinition), Arg <ReadOnlyDomainObjectCollectionAdapter <DomainObject> > .List.Equivalent(relatedDomainObjects), Arg.Is(ValueAccess.Current))); } using (ExtensionStrictMock.GetMockRepository().Ordered()) { ExtensionStrictMock.Expect(mock => mock.RelationReading(clientTransaction, domainObject, endPointDefinition, ValueAccess.Current)); ExtensionStrictMock.Expect( mock => mock.RelationRead( Arg.Is(clientTransaction), Arg.Is(domainObject), Arg.Is(endPointDefinition), Arg <ReadOnlyDomainObjectCollectionAdapter <DomainObject> > .List.Equivalent(relatedDomainObjects), Arg.Is(ValueAccess.Current))); } }
public override void SetUp() { base.SetUp(); _definition = Configuration.GetTypeDefinition(typeof(Order)).GetRelationEndPointDefinition(typeof(Order).FullName + ".OrderTicket"); _virtualObjectEndPointMock = MockRepository.GenerateStrictMock <IVirtualObjectEndPoint> (); _dataManagerMock = MockRepository.GenerateStrictMock <IVirtualObjectEndPointDataManager> (); _dataManagerMock.Stub(stub => stub.EndPointID).Return(RelationEndPointID.Create(DomainObjectIDs.Order1, _definition)); _endPointProviderStub = MockRepository.GenerateStub <IRelationEndPointProvider> (); _transactionEventSinkStub = MockRepository.GenerateStub <IClientTransactionEventSink>(); _loadState = new CompleteVirtualObjectEndPointLoadState(_dataManagerMock, _endPointProviderStub, _transactionEventSinkStub); _relatedObject = DomainObjectMother.CreateFakeObject <OrderTicket> (DomainObjectIDs.OrderTicket1); _relatedEndPointStub = MockRepository.GenerateStub <IRealObjectEndPoint> (); _relatedEndPointStub.Stub(stub => stub.GetDomainObjectReference()).Return(_relatedObject); _relatedEndPointStub.Stub(stub => stub.ObjectID).Return(_relatedObject.ID); _relatedObject2 = DomainObjectMother.CreateFakeObject <OrderTicket> (DomainObjectIDs.OrderTicket2); _relatedEndPointStub2 = MockRepository.GenerateStub <IRealObjectEndPoint> (); _relatedEndPointStub2.Stub(stub => stub.ID).Return(RelationEndPointID.Create(_relatedObject2.ID, typeof(OrderTicket), "Order")); _relatedEndPointStub2.Stub(stub => stub.GetDomainObjectReference()).Return(_relatedObject2); _relatedEndPointStub2.Stub(stub => stub.ObjectID).Return(_relatedObject2.ID); _owningObject = DomainObjectMother.CreateFakeObject <Order> (); }
public override void SetUp() { base.SetUp(); _registrationAgentMock = MockRepository.GenerateStrictMock <IFetchedRelationDataRegistrationAgent>(); _fetchResultLoaderMock = MockRepository.GenerateStrictMock <IFetchEnabledObjectLoader>(); _eagerFetcher = new EagerFetcher(_registrationAgentMock); _fetchQueryStub1 = MockRepository.GenerateStub <IQuery> (); _fetchQueryStub2 = MockRepository.GenerateStub <IQuery> (); _orderTicketEndPointDefinition = GetEndPointDefinition(typeof(Order), "OrderTicket"); _customerEndPointDefinition = GetEndPointDefinition(typeof(Order), "Customer"); _industrialSectorEndPointDefinition = GetEndPointDefinition(typeof(Company), "IndustrialSector"); _originatingOrder1 = DomainObjectMother.CreateFakeObject <Order>(); _originatingOrder2 = DomainObjectMother.CreateFakeObject <Order>(); _originatingOrderData1 = LoadedObjectDataObjectMother.CreateLoadedObjectDataStub(_originatingOrder1); _originatingOrderData2 = LoadedObjectDataObjectMother.CreateLoadedObjectDataStub(_originatingOrder2); _fetchedOrderItem1 = DomainObjectMother.CreateFakeObject <OrderItem>(); _fetchedOrderItem2 = DomainObjectMother.CreateFakeObject <OrderItem>(); _fetchedOrderItem3 = DomainObjectMother.CreateFakeObject <OrderItem>(); _fetchedOrderItemData1 = LoadedObjectDataObjectMother.CreateLoadedObjectDataWithDataSourceData(_fetchedOrderItem1); _fetchedOrderItemData2 = LoadedObjectDataObjectMother.CreateLoadedObjectDataWithDataSourceData(_fetchedOrderItem2); _fetchedOrderItemData3 = LoadedObjectDataObjectMother.CreateLoadedObjectDataWithDataSourceData(_fetchedOrderItem3); _fetchedCustomer = DomainObjectMother.CreateFakeObject <Customer>(); _fetchedCustomerData = LoadedObjectDataObjectMother.CreateLoadedObjectDataWithDataSourceData(_fetchedCustomer); _pendingRegistrationCollector = new LoadedObjectDataPendingRegistrationCollector(); }
private MappingValidationResult Validate(IRelationEndPointDefinition relationEndPointDefinition) { ArgumentUtility.CheckNotNull("relationEndPointDefinition", relationEndPointDefinition); if (relationEndPointDefinition.IsAnonymous) { return(MappingValidationResult.CreateValidResult()); } var propertyInfo = relationEndPointDefinition.PropertyInfo; if (propertyInfo == null) { return(MappingValidationResult.CreateValidResult()); } var relationAttribute = propertyInfo.GetCustomAttribute <DBBidirectionalRelationAttribute> (true); if (relationAttribute != null && relationAttribute.ContainsForeignKey && ReflectionUtility.IsObjectList(propertyInfo.PropertyType)) { return(MappingValidationResult.CreateInvalidResultForProperty( propertyInfo, "Only relation end points with a property type of '{0}' can contain the foreign key.", typeof(DomainObject).Name)); } return(MappingValidationResult.CreateValidResult()); }
private void RegisterEndPointData( IRelationEndPointDefinition relationEndPointDefinition, IEnumerable <ILoadedObjectData> originatingObjects, IDictionary <ObjectID, ILoadedObjectData> groupedRelatedObjects) { var relatedObjectsByOriginalObject = groupedRelatedObjects; foreach (var originatingObject in originatingObjects) { if (!originatingObject.IsNull && originatingObject.ObjectID.ClassDefinition.IsRelationEndPoint(relationEndPointDefinition)) { var relationEndPointID = RelationEndPointID.Create(originatingObject.ObjectID, relationEndPointDefinition); var relatedObjectData = relatedObjectsByOriginalObject.GetValueOrDefault(originatingObject.ObjectID) ?? new NullLoadedObjectData(); var relatedObject = relatedObjectData.GetDomainObjectReference(); if (relationEndPointDefinition.IsMandatory && relatedObject == null) { var message = string.Format( "The fetched mandatory relation property '{0}' on object '{1}' contains no related object.", relationEndPointDefinition.PropertyName, relationEndPointID.ObjectID); throw new InvalidOperationException(message); } if (!TrySetVirtualObjectEndPointData(relationEndPointID, relatedObject)) { s_log.DebugFormat("Relation data for relation end-point '{0}' is discarded; the end-point has already been loaded.", relationEndPointID); } } } }
public override void RelationChanging( ClientTransaction clientTransaction, DomainObject domainObject, IRelationEndPointDefinition relationEndPointDefinition, DomainObject oldRelatedObject, DomainObject newRelatedObject) { ArgumentUtility.CheckNotNull("clientTransaction", clientTransaction); ArgumentUtility.CheckNotNull("domainObject", domainObject); ArgumentUtility.CheckNotNull("relationEndPointDefinition", relationEndPointDefinition); if (IsInLoadMode) { CheckModifiedObjectID(domainObject.ID, relationEndPointDefinition.PropertyName); // This is here mostly for defensiveness purposes; it would be very difficult to construct a scenario where this is triggered. // There is no integration test for this check. if (clientTransaction.SubTransaction != null) { var endPointID = RelationEndPointID.Create(domainObject.ID, relationEndPointDefinition); var endPointInSubTransaction = clientTransaction.SubTransaction.DataManager.RelationEndPoints[endPointID]; if (endPointInSubTransaction != null && endPointInSubTransaction.IsDataComplete) { var message = string.Format( "The relation property '{0}' of object '{1}' can no longer be modified because its data has already been loaded into the subtransaction.", relationEndPointDefinition.PropertyName, domainObject.ID); throw new InvalidOperationException(message); } } } else { base.RelationChanging(clientTransaction, domainObject, relationEndPointDefinition, oldRelatedObject, newRelatedObject); } }
private MappingValidationResult Validate(IRelationEndPointDefinition relationEndPointDefinition) { ArgumentUtility.CheckNotNull("relationEndPointDefinition", relationEndPointDefinition); if (!relationEndPointDefinition.IsAnonymous && !(relationEndPointDefinition is InvalidRelationEndPointDefinitionBase)) { var relationAttribute = relationEndPointDefinition.PropertyInfo.GetCustomAttribute <BidirectionalRelationAttribute> (true); var oppositeEndPointDefinition = relationEndPointDefinition.GetOppositeEndPointDefinition(); if (oppositeEndPointDefinition != null && !oppositeEndPointDefinition.IsAnonymous && !(oppositeEndPointDefinition is InvalidRelationEndPointDefinitionBase) && relationAttribute != null) { var oppositePropertyInfo = oppositeEndPointDefinition.PropertyInfo; var classDefinition = relationEndPointDefinition.ClassDefinition; var oppositeDomainObjectType = ReflectionUtility.GetRelatedObjectTypeFromRelationProperty(oppositePropertyInfo); var declaringDomainObjectTypeForProperty = ReflectionUtility.GetDeclaringDomainObjectTypeForProperty(relationEndPointDefinition.PropertyInfo, classDefinition); bool isPropertyDeclaredByThisClassDefinition = declaringDomainObjectTypeForProperty == classDefinition.ClassType; if (isPropertyDeclaredByThisClassDefinition) { // Case where property is declared on this ClassDefinition => it is declared below/on the inheritance root // In this case, the opposite property's return type must exactly match this ClassDefinition's type. if (classDefinition.ClassType != oppositeDomainObjectType) { return(MappingValidationResult.CreateInvalidResultForProperty( relationEndPointDefinition.PropertyInfo, "The type '{0}' does not match the type of the opposite relation propery '{1}' declared on type '{2}'.", declaringDomainObjectTypeForProperty.Name, relationAttribute.OppositeProperty, oppositePropertyInfo.DeclaringType.Name)); } } else { // Case where property is not declared on this ClassDefinition => it must be declared above the inheritance root // In this case, the opposite property's return type must be assignable to the type declaring the property. This enables the following // scenario: // - ClassAboveInheritanceRoot has a relation property P1 to RelationTarget // - RelationTarget has a relation property P2 back to the InheritanceRoot derived from ClassAboveInheritanceRoot // In that case, when reflecting P1, DeclaringDomainObjectTypeForProperty will be ClassAboveInheritanceRoot, oppositeDomainObjectType will be // InheritanceRoot. ClassAboveInheritanceRoot is assignable from InheritanceRoo, so the check passes. // This is the only case where the two sides of a bidirectional relation can point to subclasses of each other. // (The scenario this was actually needed for is to allow for generic base classes above the inheritance root defining relation properties.) if (!declaringDomainObjectTypeForProperty.IsAssignableFrom(oppositeDomainObjectType)) { return(MappingValidationResult.CreateInvalidResultForProperty( relationEndPointDefinition.PropertyInfo, "The type '{0}' cannot be assigned to the type of the opposite relation propery '{1}' declared on type '{2}'.", declaringDomainObjectTypeForProperty.Name, relationAttribute.OppositeProperty, oppositePropertyInfo.DeclaringType.Name)); } } } } return(MappingValidationResult.CreateValidResult()); }
public virtual void RelationChanging( ClientTransaction clientTransaction, DomainObject domainObject, IRelationEndPointDefinition relationEndPointDefinition, DomainObject oldRelatedObject, DomainObject newRelatedObject) { }
/// <summary> /// Initializes a new instance of the <b>RelationChangingEventArgs</b> class. /// </summary> /// <param name="relationEndPointDefinition">The relation endpoint defintion. Must not be <see langword="null"/>.</param> /// <param name="oldRelatedObject">The related object that is removed from the relation, or <see langword="null" /> if a new item is added without /// replacing an old one.</param> /// <param name="newRelatedObject">The related object that is added to the relation, or <see langword="null" /> if an old item is removed without /// being replaced by a new one.</param> /// <exception cref="System.ArgumentNullException"><paramref name="relationEndPointDefinition"/> is <see langword="null"/>.</exception> public RelationChangedEventArgs(IRelationEndPointDefinition relationEndPointDefinition, DomainObject oldRelatedObject, DomainObject newRelatedObject) { ArgumentUtility.CheckNotNull("relationEndPointDefinition", relationEndPointDefinition); _relationEndPointDefinition = relationEndPointDefinition; _oldRelatedObject = oldRelatedObject; _newRelatedObject = newRelatedObject; }
public IRelationEndPointDefinition GetMandatoryOppositeEndPointDefinition(string propertyName) { ArgumentUtility.CheckNotNullOrEmpty("propertyName", propertyName); IRelationEndPointDefinition relationEndPointDefinition = GetMandatoryRelationEndPointDefinition(propertyName); return(relationEndPointDefinition.GetMandatoryOppositeEndPointDefinition()); }
public virtual void RelationRead( ClientTransaction clientTransaction, DomainObject domainObject, IRelationEndPointDefinition relationEndPointDefinition, ReadOnlyDomainObjectCollectionAdapter <DomainObject> relatedObjects, ValueAccess valueAccess) { }
public NullObjectEndPoint(ClientTransaction clientTransaction, IRelationEndPointDefinition definition) { ArgumentUtility.CheckNotNull("clientTransaction", clientTransaction); ArgumentUtility.CheckNotNull("definition", definition); _clientTransaction = clientTransaction; _definition = definition; }
private DataContainer CheckRelatedObjectAndGetDataContainer( LoadedObjectDataWithDataSourceData relatedObject, IRelationEndPointDefinition relationEndPointDefinition, IRelationEndPointDefinition oppositeEndPointDefinition) { CheckClassDefinitionOfRelatedObject(relationEndPointDefinition, oppositeEndPointDefinition, relatedObject.LoadedObjectData.ObjectID); return(relatedObject.DataSourceData); }
public static RelationEndPointID CreateOpposite(IRelationEndPointDefinition sourceEndPointDefinition, ObjectID oppositeObjectID) { ArgumentUtility.CheckNotNull("sourceEndPointDefinition", sourceEndPointDefinition); var oppositeEndPointDefinition = sourceEndPointDefinition.GetOppositeEndPointDefinition(); return(Create(oppositeObjectID, oppositeEndPointDefinition)); }
public void RaiseRelationReadingEvent(DomainObject domainObject, IRelationEndPointDefinition relationEndPointDefinition, ValueAccess valueAccess) { ArgumentUtility.CheckNotNull("domainObject", domainObject); ArgumentUtility.CheckNotNull("relationEndPointDefinition", relationEndPointDefinition); _listenerCollection.RelationReading(_clientTransaction, domainObject, relationEndPointDefinition, valueAccess); _extensionCollection.RelationReading(_clientTransaction, domainObject, relationEndPointDefinition, valueAccess); }
public void GroupAndRegisterRelatedObjects(IRelationEndPointDefinition relationEndPointDefinition, ICollection <ILoadedObjectData> originatingObjects, ICollection <LoadedObjectDataWithDataSourceData> relatedObjects) { ArgumentUtility.CheckNotNull("relationEndPointDefinition", relationEndPointDefinition); ArgumentUtility.CheckNotNullOrEmpty("originatingObjects", originatingObjects); var specificAgent = GetSpecificAgent(relationEndPointDefinition); specificAgent.GroupAndRegisterRelatedObjects(relationEndPointDefinition, originatingObjects, relatedObjects); }
public override void SetUp() { base.SetUp(); _definition = DomainObjectIDs.Order1.ClassDefinition.GetRelationEndPointDefinition(typeof(Order).FullName + ".OrderTicket"); _nullEndPoint = new NullVirtualObjectEndPoint(TestableClientTransaction, _definition); _oppositeEndPointStub = MockRepository.GenerateStub <IRealObjectEndPoint>(); }
private static void CheckSingleFetchRequest( EagerFetchQueryCollection fetchQueryCollection, IRelationEndPointDefinition relationEndPointDefinition, string expectedFetchQueryText) { Assert.That(fetchQueryCollection.Count, Is.EqualTo(1)); var fetchQuery = fetchQueryCollection.Single(); Assert.That(fetchQuery.Key, Is.EqualTo(relationEndPointDefinition)); Assert.That(fetchQuery.Value.Statement, Is.EqualTo(expectedFetchQueryText)); }
public virtual void RelationRead( ClientTransaction clientTransaction, DomainObject domainObject, IRelationEndPointDefinition relationEndPointDefinition, DomainObject relatedObject, ValueAccess valueAccess) { // Handled by Begin event }
public virtual void RelationChanged( ClientTransaction clientTransaction, DomainObject domainObject, IRelationEndPointDefinition relationEndPointDefinition, DomainObject oldRelatedObject, DomainObject newRelatedObject) { // Handled by Begin event }
public void RelationChanged(IRelationEndPointDefinition relationEndPointDefinition, DomainObject oldRelatedObject, DomainObject newRelatedObject) { this.Expect( mock => RelationChanged( Arg.Is(_domainObject), Arg <RelationChangedEventArgs> .Matches(args => args.RelationEndPointDefinition == relationEndPointDefinition && args.OldRelatedObject == oldRelatedObject && args.NewRelatedObject == newRelatedObject))); }
public override void SetUp() { base.SetUp(); _objectID = DomainObjectIDs.Order1; _propertyName = "Remotion.Data.DomainObjects.UnitTests.TestDomain.Order.OrderTicket"; _endPointDefinition = _objectID.ClassDefinition.GetMandatoryRelationEndPointDefinition(_propertyName); _endPointID = RelationEndPointID.Create(_objectID, _propertyName); _nullEndPointID = RelationEndPointID.Create(null, _endPointID.Definition); }
public override void SetUp() { base.SetUp(); _validator = new MandatoryRelationValidator(); _endPointMock = MockRepository.GenerateStrictMock <IRelationEndPoint>(); _mandatoryEndPointDefinition = GetEndPointDefinition(typeof(Order), "OrderTicket"); _nonMandatoryEndPointDefinition = GetEndPointDefinition(typeof(Computer), "Employee"); }