Ejemplo n.º 1
0
		public void Test_Valid_Relationship()
		{
			//----------------------Test Setup ----------------------
			const string classDefsString =
				@"
					<classes>
						<class name=""TestClass"" assembly=""Habanero.Test.BO.Loaders"" >
							<property  name=""TestClassID"" type=""Guid"" />
							<primaryKey>
								<prop name=""TestClassID""/>
							</primaryKey>
							<relationship name=""TestRelatedClass"" type=""single"" relatedClass=""TestRelatedClass"" relatedAssembly=""Habanero.Test.BO.Loaders"">
								<relatedProperty property=""TestClassID"" relatedProperty=""TestClassID"" />
							</relationship>
						</class>
						<class name=""TestRelatedClass"" assembly=""Habanero.Test.BO.Loaders"" >
							<property  name=""TestRelatedClassID""  type=""Guid"" />
							<property  name=""TestClassID"" />
							<primaryKey>
								<prop name=""TestRelatedClassID""/>
							</primaryKey>
						</class>
					</classes>
			";
			XmlClassDefsLoader loader = new XmlClassDefsLoader("", new DtdLoader(), GetDefClassFactory());
			ClassDefCol classDefList = loader.LoadClassDefs(classDefsString);
			ClassDefValidator defValidator = new ClassDefValidator(GetDefClassFactory());
			//--------------------Assert Preconditions-----------------
			Assert.AreEqual(2, classDefList.Count);
			Assert.IsTrue(classDefList.Contains("Habanero.Test.BO.Loaders", "TestClass"),
						  "Class 'TestClass' should have been loaded.");
			Assert.IsTrue(classDefList.Contains("Habanero.Test.BO.Loaders", "TestRelatedClass"),
						  "Class 'TestRelatedClass' should have been loaded.");
			//--------------------Execute Test-------------------------
			defValidator.ValidateClassDefs(classDefList);
			//--------------------Assert Results ----------------------
		}
 public void TestAccept_Validate_WhenAllClassDefsLoaded_ShouldBeTrue()
 {
     //---------------Set up test pack-------------------
     Func<TypeWrapper, bool> whereClause = type
             => (type.Namespace == "Habanero.Smooth.Test.ValidFakeBOs");
     AppDomainTypeSource source = new AppDomainTypeSource(whereClause);
     AllClassesAutoMapper allClassesAutoMapper = new AllClassesAutoMapper(source);
     ClassDefCol classDefCol = allClassesAutoMapper.Map();
     ClassDefValidator validator = new ClassDefValidator(new DefClassFactory());
     //---------------Assert Precondition----------------
     Assert.Greater(classDefCol.Count, 0);
     //---------------Execute Test ----------------------
     validator.ValidateClassDefs(classDefCol);
     //---------------Test Result -----------------------
     Assert.IsNotNull(classDefCol);
     //Should Validate without Error if it gets here then it has validated
 }
Ejemplo n.º 3
0
		public void TestLoadClassDefs_KeyDefinedWithInheritedProperties()
		{
			//-------------Setup Test Pack ------------------
			const string xml =
				@"
					<classes>
						<class name=""TestClass"" assembly=""Habanero.Test.BO.Loaders"" >
							<property  name=""TestClassID"" type=""Guid"" />
							<property  name=""TestClassName"" />
							<primaryKey>
								<prop name=""TestClassID""/>
							</primaryKey>
						</class>
						<class name=""TestClassInherited"" assembly=""Habanero.Test.BO.Loaders"" >							
							<superClass class=""TestClass"" assembly=""Habanero.Test.BO.Loaders"" />
							<key>
								<prop name=""TestClassName""/>
							</key>
						</class>
					</classes>
			";
			var loader = new XmlClassDefsLoader("", new DtdLoader(), GetDefClassFactory());
			var classDefList = loader.LoadClassDefs(xml);
			var validator = new ClassDefValidator(GetDefClassFactory());
			//--------------------Assert Preconditions-----------------
			var classDefTestClass = classDefList["Habanero.Test.BO.Loaders", "TestClass"];
			var propDef = classDefTestClass.PropDefcol["TestClassName"];
			var classDefInherited = classDefList["Habanero.Test.BO.Loaders", "TestClassInherited"];
			var keyDef = classDefInherited.KeysCol.GetKeyDefAtIndex(0);
			var keyDefPropDef = keyDef["TestClassName"];
			Assert.AreNotSame(propDef, keyDefPropDef,
							  "The key's property should have been resolved to be the property of the superclass by the validator.");
			//-------------Execute test ---------------------
			validator.ValidateClassDefs(classDefList);
			//-------------Test Result ----------------------
			var keyDefPropDefAfterValidate = keyDef["TestClassName"];
			Assert.AreSame(propDef, keyDefPropDefAfterValidate,
						   "The key's property should have been resolved to be the property of the superclass by the loader.");
		}
Ejemplo n.º 4
0
		public void Test_Validate_PrimaryKey_IsObjectID_True_NonGuidProp()
		{
			//-------------Setup Test Pack ------------------
			const string xml =
				@"
				<classes>
					<class name=""TestClass"" assembly=""Habanero.Test.BO.Loaders"" >
						<property name=""TestClassID""/>
						<primaryKey isObjectID=""true"">
							<prop name=""TestClassID""/>
						</primaryKey>
					</class>
				</classes>
			";
			XmlClassDefsLoader loader = CreateXmlClassDefsLoader();
			ClassDefCol classDefList = loader.LoadClassDefs(xml);
			ClassDefValidator validator = new ClassDefValidator(GetDefClassFactory());

			//-------------Execute test ---------------------
			try
			{
				validator.ValidateClassDefs(classDefList);
				//---------------Test Result -----------------------
				Assert.Fail("Should have thrown an InvalidXmlDefinitionException");
			}
			catch (InvalidXmlDefinitionException ex)
			{
				Assert.AreEqual(
					"In the class called 'TestClass', the primary key is set as IsObjectID but the property 'TestClassID' " +
					"defined as part of the ObjectID primary key is not a Guid.", ex.Message);
			}
		}
Ejemplo n.º 5
0
		public void Test_Force_PrimaryKey_IsObjectID_AsCompulsoryWriteOnce_WithReadWriteRule_WriteNew()
		{
			//-------------Setup Test Pack ------------------
			const string xml =
				@"
				<classes>
					<class name=""TestClass"" assembly=""Habanero.Test.BO.Loaders"" >
						<property name=""TestClassID"" type=""Guid"" readWriteRule=""WriteNew""/>
						<primaryKey isObjectID=""true"">
							<prop name=""TestClassID""/>
						</primaryKey>
					</class>
				</classes>
			";
			XmlClassDefsLoader loader = CreateXmlClassDefsLoader();
			ClassDefCol classDefList = loader.LoadClassDefs(xml);
			ClassDefValidator validator = new ClassDefValidator(GetDefClassFactory());
			IClassDef classDef = classDefList["Habanero.Test.BO.Loaders", "TestClass"];
			IPropDef keyPropDef = classDef.PrimaryKeyDef[0];
			//---------------Assert PreConditions---------------        
			Assert.IsFalse(keyPropDef.Compulsory);
			Assert.AreEqual(PropReadWriteRule.WriteNew, keyPropDef.ReadWriteRule);
			//-------------Execute test ---------------------
			validator.ValidateClassDefs(classDefList);
			//---------------Test Result -----------------------
			Assert.IsTrue(keyPropDef.Compulsory);
			Assert.AreEqual(PropReadWriteRule.WriteNew, keyPropDef.ReadWriteRule);
		}
Ejemplo n.º 6
0
		public void Test_Invalid_Relationship_RelatedClassDefDoesNotExist()
		{
			//----------------------Test Setup ----------------------
			const string classDefsString =
				@"
					<classes>
						<class name=""TestClass"" assembly=""Habanero.Test.BO.Loaders"" >
							<property  name=""TestClassID"" type=""Guid"" />
							<primaryKey>
								<prop name=""TestClassID""/>
							</primaryKey>
							<relationship name=""TestRelatedClass"" type=""single"" relatedClass=""RelatedClassDoesNotExist"" relatedAssembly=""Habanero.Test.BO.Loaders"">
								<relatedProperty property=""TestClassID"" relatedProperty=""TestClassID"" />
							</relationship>
						</class>
						<class name=""TestRelatedClass"" assembly=""Habanero.Test.BO.Loaders"" >
							<property  name=""TestRelatedClassID"" type=""Guid"" />
							<property  name=""TestClassID"" type=""Guid"" />
							<primaryKey>
								<prop name=""TestRelatedClassID""/>
							</primaryKey>
						</class>
					</classes>
			";
			XmlClassDefsLoader loader = CreateXmlClassDefsLoader();
			ClassDefCol classDefList = loader.LoadClassDefs(classDefsString);
			ClassDefValidator validator = new ClassDefValidator(GetDefClassFactory());
			//--------------------Execute Test-------------------------
			try
			{
				validator.ValidateClassDefs(classDefList);
				Assert.Fail("expected Err");
			}
				//---------------Test Result -----------------------
			catch (InvalidXmlDefinitionException ex)
			{
				StringAssert.Contains(
					"The relationship 'TestRelatedClass' could not be loaded because when trying to retrieve its related class the folllowing",
					ex.Message);
			}
		}
Ejemplo n.º 7
0
		public void Test_Invalid_Relationship_SingleSingleRelationships_ReverseRelationshipNotDefined()
		{
			//----------------------Test Setup ----------------------
			const string classDefsString =
				@"
					<classes>
						<class name=""TestClass"" assembly=""Habanero.Test.BO.Loaders"" >
							<property  name=""TestClassID"" type=""Guid"" />
							<primaryKey>
								<prop name=""TestClassID""/>
							</primaryKey>
							<relationship name=""TestRelatedClass"" type=""single"" relatedClass=""TestRelatedClass"" relatedAssembly=""Habanero.Test.BO.Loaders"" owningBOHasForeignKey=""true"" reverseRelationship=""ReverseRelNonExist"">
								<relatedProperty property=""TestClassID"" relatedProperty=""TestClassID"" />
							</relationship>
						</class>
						<class name=""TestRelatedClass"" assembly=""Habanero.Test.BO.Loaders"" >
							<property  name=""TestRelatedClassID"" type=""Guid"" />
							<property  name=""TestClassID"" type=""Guid"" />
							<primaryKey>
								<prop name=""TestRelatedClassID""/>
							</primaryKey>
							<relationship name=""TestClass"" type=""single"" relatedClass=""TestClass"" relatedAssembly=""Habanero.Test.BO.Loaders"" owningBOHasForeignKey=""true"" reverseRelationship=""TestRelatedClass"">
								<relatedProperty property=""TestClassID"" relatedProperty=""TestClassID"" />
							</relationship>
						</class>
					</classes>
			";
			XmlClassDefsLoader loader = CreateXmlClassDefsLoader();
			ClassDefCol classDefList = loader.LoadClassDefs(classDefsString);
			ClassDefValidator validator = new ClassDefValidator(GetDefClassFactory());
			//--------------------Execute Test-------------------------
			try
			{
				validator.ValidateClassDefs(classDefList);
				Assert.Fail("expected Err");
			}
				//---------------Test Result -----------------------
			catch (InvalidXmlDefinitionException ex)
			{
				StringAssert.Contains("The relationship 'TestRelatedClass' could not be loaded for because "
									  + "the reverse relationship 'ReverseRelNonExist'", ex.Message);
			}
		}
Ejemplo n.º 8
0
		public void Test_Valid_Relationship_1_M_Relationships_CanDetermine_OwningBOHasForeignKey_SecondClass_NotSetUp()
		{
			//----------------------Test Setup ----------------------
			const string classDefsString =
				@"
					<classes>
						<class name=""TestClass"" assembly=""Habanero.Test.BO.Loaders"" >
							<property  name=""TestClassID"" type=""Guid"" />
							<primaryKey>
								<prop name=""TestClassID""/>
							</primaryKey>
							<relationship name=""TestRelatedClass"" type=""multiple"" relatedClass=""TestRelatedClass"" relatedAssembly=""Habanero.Test.BO.Loaders"" 
											reverseRelationship=""TestClass"" owningBOHasForeignKey=""true"" >
								<relatedProperty property=""TestClassID"" relatedProperty=""TestClassID"" />
							</relationship>
						</class>
						<class name=""TestRelatedClass"" assembly=""Habanero.Test.BO.Loaders"" >
							<property  name=""TestRelatedClassID"" type=""Guid"" />
							<property  name=""TestClassID"" type=""Guid"" />
							<primaryKey>
								<prop name=""TestRelatedClassID""/>
							</primaryKey>
							<relationship name=""TestClass"" type=""single"" relatedClass=""TestClass"" relatedAssembly=""Habanero.Test.BO.Loaders"" 
											reverseRelationship=""TestRelatedClass"" >
								<relatedProperty property=""TestClassID"" relatedProperty=""TestClassID"" />
							</relationship>
						</class>
					</classes>
			";
			XmlClassDefsLoader loader = CreateXmlClassDefsLoader();
			ClassDefCol classDefList = loader.LoadClassDefs(classDefsString);
			ClassDefValidator validator = new ClassDefValidator(GetDefClassFactory());
			IClassDef classDef = classDefList.FindByClassName("TestClass");
			IRelationshipDef relationshipDef = classDef.RelationshipDefCol["TestRelatedClass"];
			IClassDef reverseClassDef = classDefList.FindByClassName("TestRelatedClass");
			IRelationshipDef reverseRelationshipDef = reverseClassDef.RelationshipDefCol["TestClass"];
			//---------------Assert PreConditions---------------        
			Assert.IsFalse(relationshipDef.OwningBOHasForeignKey);
			Assert.IsTrue(reverseRelationshipDef.OwningBOHasForeignKey);
			//--------------------Execute Test-------------------------
			validator.ValidateClassDefs(classDefList);
			//---------------Test Result -----------------------
			Assert.IsFalse(relationshipDef.OwningBOHasForeignKey);
			Assert.IsTrue(reverseRelationshipDef.OwningBOHasForeignKey);
		}
Ejemplo n.º 9
0
		public void Test_Valid_Relationship_SingleSingleRelationships_OnlyOneHasOwningBOHasForeignKey()
		{
			//----------------------Test Setup ----------------------
			const string classDefsString =
				@"
					<classes>
						<class name=""TestClass"" assembly=""Habanero.Test.BO.Loaders"" >
							<property  name=""TestClassID"" type=""Guid"" />
							<primaryKey>
								<prop name=""TestClassID""/>
							</primaryKey>
							<relationship name=""TestRelatedClass"" type=""single"" relatedClass=""TestRelatedClass"" relatedAssembly=""Habanero.Test.BO.Loaders"" owningBOHasForeignKey=""true"" reverseRelationship=""TestClass"">
								<relatedProperty property=""TestClassID"" relatedProperty=""TestClassID"" />
							</relationship>
						</class>
						<class name=""TestRelatedClass"" assembly=""Habanero.Test.BO.Loaders"" >
							<property  name=""TestRelatedClassID"" type=""Guid"" />
							<property  name=""TestClassID"" type=""Guid"" />
							<primaryKey>
								<prop name=""TestRelatedClassID""/>
							</primaryKey>
							<relationship name=""TestClass"" type=""single"" relatedClass=""TestClass"" relatedAssembly=""Habanero.Test.BO.Loaders"" reverseRelationship=""TestRelatedClass"" owningBOHasForeignKey=""false"" >
								<relatedProperty property=""TestClassID"" relatedProperty=""TestClassID"" />
							</relationship>
						</class>
					</classes>
			";
			XmlClassDefsLoader loader = CreateXmlClassDefsLoader();
			ClassDefCol classDefList = loader.LoadClassDefs(classDefsString);
			ClassDefValidator validator = new ClassDefValidator(GetDefClassFactory());
			//--------------------Assert PreConditions---------------   
			IClassDef classDef = classDefList.FindByClassName("TestClass");
			IRelationshipDef relationshipDef = classDef.RelationshipDefCol["TestRelatedClass"];
			Assert.IsTrue(relationshipDef.OwningBOHasForeignKey, "This defaults to true");
			IClassDef revesreclassDef = classDefList.FindByClassName("TestClass");
			IRelationshipDef reverserelationshipDef = revesreclassDef.RelationshipDefCol["TestRelatedClass"];
			Assert.IsTrue(reverserelationshipDef.OwningBOHasForeignKey, "This defaults to true");

			//--------------------Execute Test-------------------------
			validator.ValidateClassDefs(classDefList);
			//---------------Test Result -----------------------
			Assert.IsFalse(relationshipDef.OwningBOHasForeignKey, "Should have converted this to false");
			Assert.IsFalse(reverserelationshipDef.OwningBOHasForeignKey, "Should have converted this to false");
		}
Ejemplo n.º 10
0
		public void Test_Invalid_Relationship_PropDefDoesNotExistOnOwningClassDef()
		{
			//----------------------Test Setup ----------------------
			const string classDefsString =
				@"
					<classes>
						<class name=""TestClass"" assembly=""Habanero.Test.BO.Loaders"" >
							<property  name=""TestClassID"" type=""Guid"" />
							<primaryKey>
								<prop name=""TestClassID""/>
							</primaryKey>
							<relationship name=""TestRelatedClass"" type=""single"" relatedClass=""TestRelatedClass"" relatedAssembly=""Habanero.Test.BO.Loaders"">
								<relatedProperty property=""PropDefDoesNonExist"" relatedProperty=""TestClassID"" />
							</relationship>
						</class>
						<class name=""TestRelatedClass"" assembly=""Habanero.Test.BO.Loaders"" >
							<property  name=""TestRelatedClassID"" type=""Guid"" />
							<property  name=""TestClassID"" type=""Guid"" />
							<primaryKey>
								<prop name=""TestRelatedClassID""/>
							</primaryKey>
						</class>
					</classes>
			";
			XmlClassDefsLoader loader = CreateXmlClassDefsLoader();
			ClassDefCol classDefs = loader.LoadClassDefs(classDefsString);
			ClassDefValidator validator = new ClassDefValidator(GetDefClassFactory());
			//--------------------Execute Test-------------------------
			try
			{
				validator.ValidateClassDefs(classDefs);
				Assert.Fail("expected Err");
			}
				//---------------Test Result -----------------------
			catch (InvalidXmlDefinitionException ex)
			{
				StringAssert.Contains(
					"In a 'relatedProperty' element for the 'TestRelatedClass' relationship of the 'TestClass' class, " +
					"the property 'PropDefDoesNonExist' given in the 'property' attribute does not exist", ex.Message);
			}
		}
Ejemplo n.º 11
0
		public void Test_Invalid_Relationship_PropDefForReverseRelationshipNotSameAsRelationship()
		{
			//----------------------Test Setup ----------------------
			const string classDefsString =
				@"
					<classes>
						<class name=""TestClass"" assembly=""Habanero.Test.BO.Loaders"" >
							<property  name=""TestClassID"" type=""Guid"" />
							<property  name=""OtherFieldID"" />
							<primaryKey>
								<prop name=""TestClassID""/>
							</primaryKey>
							<relationship name=""TestRelatedClass"" type=""single"" relatedClass=""TestRelatedClass"" relatedAssembly=""Habanero.Test.BO.Loaders"" owningBOHasForeignKey=""true"" reverseRelationship=""TestClass"">
								<relatedProperty property=""OtherFieldID"" relatedProperty=""TestClassID"" />
							</relationship>
						</class>
						<class name=""TestRelatedClass"" assembly=""Habanero.Test.BO.Loaders"" >
							<property  name=""TestRelatedClassID"" type=""Guid"" />
							<property  name=""TestClassID"" type=""Guid"" />
							<primaryKey>
								<prop name=""TestRelatedClassID""/>
							</primaryKey>
							<relationship name=""TestClass"" type=""single"" relatedClass=""TestClass"" relatedAssembly=""Habanero.Test.BO.Loaders"" reverseRelationship=""TestRelatedClass"" owningBOHasForeignKey=""false"" >
								<relatedProperty property=""TestClassID"" relatedProperty=""TestClassID"" />
							</relationship>
						</class>
					</classes>
			";
			XmlClassDefsLoader loader = CreateXmlClassDefsLoader();
			ClassDefCol classDefs = loader.LoadClassDefs(classDefsString);
			ClassDefValidator validator = new ClassDefValidator(GetDefClassFactory());
			//--------------------Execute Test-------------------------
			try
			{
				validator.ValidateClassDefs(classDefs);
				Assert.Fail("expected Err");
			}
				//---------------Test Result -----------------------
			catch (InvalidXmlDefinitionException ex)
			{
				StringAssert.Contains("do not have the same properties defined as the relationship keys", ex.Message);
			}
		}
Ejemplo n.º 12
0
		public void TestLoadClassDefs_KeyDefinedWithNonExistantProperty()
		{
			//-------------Setup Test Pack ------------------
			const string xml =
				@"
				<classes>
					<class name=""TestClass"" assembly=""Habanero.Test.BO.Loaders"" >
						<property  name=""TestClassID"" />
						<property  name=""TestClassName"" />
						<primaryKey>
							<prop name=""TestClassID""/>
						</primaryKey>
					</class>
					<class name=""TestClassInherited"" assembly=""Habanero.Test.BO.Loaders"" >							
						<superClass class=""TestClass"" assembly=""Habanero.Test.BO.Loaders"" />
						<key>
							<prop name=""DoesNotExist""/>
						</key>
					</class>
				</classes>
			";
			XmlClassDefsLoader loader = new XmlClassDefsLoader("", new DtdLoader(), GetDefClassFactory());
			ClassDefCol classDefs = loader.LoadClassDefs(xml);
			ClassDefValidator validator = new ClassDefValidator(GetDefClassFactory());
			//-------------Execute test ---------------------
			try
			{
				validator.ValidateClassDefs(classDefs);
				Assert.Fail("expected Err");
			}
				//---------------Test Result -----------------------
			catch (InvalidXmlDefinitionException ex)
			{
				StringAssert.Contains("In a 'prop' element for the '' key of the 'TestClassInherited' class, " +
									  "the propery 'DoesNotExist' given in the 'name' attribute does not exist for the class or " +
									  "for any of it's superclasses. Either add the property definition or check the spelling and " +
									  "capitalisation of the specified property", ex.Message);
			}
		}
Ejemplo n.º 13
0
 /// <summary>
 /// Loads the class definitions
 /// </summary>
 protected override void SetupClassDefs()
 {
     if (LoadClassDefs)
     {
         ClassDef.ClassDefs.Add(GetXmlClassDefsLoader().LoadClassDefs());
         ClassDefValidator validator = new ClassDefValidator(new DefClassFactory());
         validator.ValidateClassDefs(ClassDef.ClassDefs); 
     }
 }
		public void TestAutoMap_WithTwoSingleRelationshipToTheSameBO_WhereReverseRelsAreDefined_WithPropAndRelNameMatching()
		{
			//---------------Set up test pack-------------------
			const string parentClassDefXML = @"<classes> 
						<class name=""FakeBOWithTwoRelToSameProp"" assembly=""Habanero.Smooth.Test"">
							<property name =""FakeBOWithTwoRelToSamePropID"" type=""Guid""/>
							<primaryKey isObjectID=""true"">
								<prop name=""FakeBOWithTwoRelToSamePropID"" />
							</primaryKey>
							<relationship name=""FakeBOWithTwoSingleRelToSamePropWithSameNames"" type=""multiple"" relatedClass=""FakeBOWithTwoSingleRelToSamePropWithSameName"" reverseRelationship=""FakeBOWithTwoRelToSameProp"" relatedAssembly=""Habanero.Smooth.Test"">
							<relatedProperty property=""FakeBOWithTwoRelToSamePropID"" relatedProperty=""FakeBOWithTwoRelToSamePropID"" />
							</relationship>
							<relationship name=""FakeBORel2"" type=""multiple"" relatedClass=""FakeBOWithTwoSingleRelToSamePropWithSameName"" reverseRelationship=""SingleRel2"" relatedAssembly=""Habanero.Smooth.Test"">
							<relatedProperty property=""FakeBOWithTwoRelToSamePropID"" relatedProperty=""SingleRel2ID"" />
							</relationship>
						</class>
					</classes>";	

			//---------------Assert Precondition----------------
			//---------------Execute Test ----------------------
			var xmlClassDefsLoader = new XmlClassDefsLoader(parentClassDefXML, new DtdLoader());
			var loadedClassDefs = xmlClassDefsLoader.LoadClassDefs();
			var relatedClassType = typeof(FakeBOWithTwoSingleRelToSamePropWithSameName);
			var allClassesAutoMapper = new AllClassesAutoMapper(new CustomTypeSource(new[] { relatedClassType }));
			AllClassesAutoMapper.ClassDefCol = loadedClassDefs;
			allClassesAutoMapper.Map();
			//---------------Test Result -----------------------
			Assert.AreEqual(2, AllClassesAutoMapper.ClassDefCol.Count);
			var relationshipDefCol = AllClassesAutoMapper.ClassDefCol[relatedClassType].RelationshipDefCol;
			Assert.AreEqual(2, relationshipDefCol.Count);
			var relationshipDef = relationshipDefCol["FakeBOWithTwoRelToSameProp"];
			Assert.AreEqual("FakeBOWithTwoSingleRelToSamePropWithSameNames", relationshipDef.ReverseRelationshipName);
			var relationshipDef2 = relationshipDefCol["SingleRel2"];
			Assert.AreEqual("FakeBORel2", relationshipDef2.ReverseRelationshipName);
			var validator = new ClassDefValidator(new DefClassFactory());
			validator.ValidateClassDefs(AllClassesAutoMapper.ClassDefCol);
		}