public override void SetUp() { base.SetUp(); _classDefinitionChecker = new ClassDefinitionChecker(); _endPointDefinitionChecker = new RelationEndPointDefinitionChecker(); }
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 CheckRelationEndPoints(IEnumerable <ClassDefinition> expectedDefinitions, IDictionary <Type, ClassDefinition> actualDefinitions) { ArgumentUtility.CheckNotNull("expectedDefinitions", expectedDefinitions); ArgumentUtility.CheckNotNull("actualDefinitions", actualDefinitions); foreach (var expectedDefinition in expectedDefinitions) { var actualDefinition = actualDefinitions[expectedDefinition.ClassType]; var endPointDefinitionChecker = new RelationEndPointDefinitionChecker(); endPointDefinitionChecker.Check(expectedDefinition.MyRelationEndPointDefinitions, actualDefinition.MyRelationEndPointDefinitions, true); } }