Permalink
Browse files

Got ForeignKey conventions working again for many-to-one's. Baby steps.

  • Loading branch information...
jagregory committed Jun 10, 2009
1 parent db6c58b commit bb50da5868adc5069eef35f32d91293dfd7e5fce
Showing with 773 additions and 429 deletions.
  1. +47 −0 src/AlterationDslCoverage.ncover
  2. +8 −8 ...ibernate.Testing/ConventionsTests/AcceptanceCriteria/PropertyAcceptanceCriteriaCollectionTests.cs
  3. +6 −6 ...te.Testing/ConventionsTests/AcceptanceCriteria/PropertyAcceptanceCriteriaEqualComplexTypeTests.cs
  4. +6 −6 ...Testing/ConventionsTests/AcceptanceCriteria/PropertyAcceptanceCriteriaEqualSimpleTypeEvalTests.cs
  5. +6 −6 ...ate.Testing/ConventionsTests/AcceptanceCriteria/PropertyAcceptanceCriteriaEqualSimpleTypeTests.cs
  6. +1 −1 ...te.Testing/ConventionsTests/AcceptanceCriteria/PropertyAcceptanceCriteriaEqualSubPropertyTests.cs
  7. +2 −2 ...bernate.Testing/ConventionsTests/AcceptanceCriteria/PropertyAcceptanceCriteriaInheritanceTests.cs
  8. +13 −13 ...entNHibernate.Testing/ConventionsTests/AcceptanceCriteria/PropertyAcceptanceCriteriaIsSetTests.cs
  9. +5 −5 src/FluentNHibernate.Testing/ConventionsTests/AcceptanceCriteria/PropertyAcceptanceCriteriaTests.cs
  10. +28 −0 src/FluentNHibernate.Testing/ConventionsTests/Alterations/PropertyAlterationMapsToPropertyMapping.cs
  11. +2 −1 src/FluentNHibernate.Testing/ConventionsTests/Inspection/ColumnDslMapsToColumnMapping.cs
  12. +1 −8 src/FluentNHibernate.Testing/ConventionsTests/Inspection/PropertyDslMapsToPropertyMapping.cs
  13. +15 −13 src/FluentNHibernate.Testing/DomainModel/Mapping/ClassMapXmlCreationTester.cs
  14. +1 −0 src/FluentNHibernate.Testing/FluentNHibernate.Testing.csproj
  15. +21 −14 src/FluentNHibernate.Testing/MappingModel/Output/XmlManyToOneWriterTester.cs
  16. +5 −0 src/FluentNHibernate/Conventions/Alterations/IColumnAlteration.cs
  17. +8 −0 src/FluentNHibernate/Conventions/Alterations/IManyToManyAlteration.cs
  18. +7 −0 src/FluentNHibernate/Conventions/Alterations/IManyToOneAlteration.cs
  19. +7 −0 src/FluentNHibernate/Conventions/Alterations/IOneToManyAlteration.cs
  20. +27 −3 src/FluentNHibernate/Conventions/ConventionVisitor.cs
  21. +7 −7 src/FluentNHibernate/Conventions/Defaults/DefaultForeignKeyConvention.cs
  22. +15 −0 src/FluentNHibernate/Conventions/DslImplementation/ColumnAlteration.cs
  23. +14 −18 src/FluentNHibernate/Conventions/DslImplementation/{ColumnDsl.cs → ColumnInspector.cs}
  24. +21 −0 src/FluentNHibernate/Conventions/DslImplementation/ManyToOneAlteration.cs
  25. +69 −0 src/FluentNHibernate/Conventions/DslImplementation/ManyToOneInspector.cs
  26. +98 −0 src/FluentNHibernate/Conventions/DslImplementation/PropertyAlteration.cs
  27. +0 −243 src/FluentNHibernate/Conventions/DslImplementation/PropertyDsl.cs
  28. +150 −0 src/FluentNHibernate/Conventions/DslImplementation/PropertyInspector.cs
  29. +47 −46 src/FluentNHibernate/Conventions/ForeignKeyConvention.cs
  30. +8 −0 src/FluentNHibernate/Conventions/IColumnConvention.cs
  31. +7 −6 src/FluentNHibernate/Conventions/IHasManyConvention.cs
  32. +7 −6 src/FluentNHibernate/Conventions/IHasManyToManyConvention.cs
  33. +0 −1 src/FluentNHibernate/Conventions/IPropertyConvention.cs
  34. +8 −6 src/FluentNHibernate/Conventions/IReferenceConvention.cs
  35. +7 −0 src/FluentNHibernate/Conventions/Inspections/Cascade.cs
  36. +7 −0 src/FluentNHibernate/Conventions/Inspections/IAccessInspector.cs
  37. +7 −0 src/FluentNHibernate/Conventions/Inspections/ICascadeInspector.cs
  38. +10 −0 src/FluentNHibernate/Conventions/Inspections/IManyToManyInspector.cs
  39. +12 −0 src/FluentNHibernate/Conventions/Inspections/IManyToOneInspector.cs
  40. +9 −0 src/FluentNHibernate/Conventions/Inspections/IOneToManyInspector.cs
  41. +7 −0 src/FluentNHibernate/Conventions/Inspections/IOuterJoinInspector.cs
  42. +1 −2 src/FluentNHibernate/Conventions/Inspections/IPropertyInspector.cs
  43. +7 −0 src/FluentNHibernate/Conventions/Inspections/OuterJoin.cs
  44. +19 −2 src/FluentNHibernate/FluentNHibernate.csproj
  45. +3 −4 src/FluentNHibernate/Mapping/ManyToOnePart.cs
  46. +1 −1 src/FluentNHibernate/MappingModel/DiscriminatorMapping.cs
  47. +1 −0 src/FluentNHibernate/MappingModel/ManyToOneMapping.cs
  48. +14 −0 src/FluentNHibernate/MappingModel/Output/XmlManyToOneWriter.cs
  49. +1 −1 src/FluentNHibernate/MappingModel/Output/XmlWriterContainer.cs
@@ -0,0 +1,47 @@
+<?xml version="1.0"?>
+<NCover3ProjectSetting xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" Version="307">
+ <CoverageDataURL>C:\Documents and Settings\Administrator\dev\fluent-nhibernate\src\FluentNHibernate.Testing\bin\x86\Debug\coverage.xml</CoverageDataURL>
+ <ShowExcludedNodes>false</ShowExcludedNodes>
+ <DefaultViewSetting SatisfactoryBranchThreshold="95" SatisfactoryCoverageThreshold="95" SatisfactoryCyclomaticComplexityThreshold="20" SatisfactoryFunctionThreshold="80" SatisfactoryUnvisitedSequencePoints="0" WidgetType="TreeView" FilterStyle="None" ReportStyle="SequencePointCoveragePercentage" SortStyle="Name">
+ <DelayFilters>false</DelayFilters>
+ <filters />
+ </DefaultViewSetting>
+ <NCoverRunSettings>
+ <AutoExclude>true</AutoExclude>
+ <CommandLineArgs>FluentNHibernate.Testing.dll /include="Alteration DSL"</CommandLineArgs>
+ <CommandLineExe>C:\Documents and Settings\Administrator\dev\fluent-nhibernate\tools\nunit\nunit-console.exe</CommandLineExe>
+ <CoverageType>Symbol Branch CyclomaticComplexity MethodVisits</CoverageType>
+ <CoverageXml>coverage.xml</CoverageXml>
+ <TypeExclusionPatterns>FluentNHibernate.MappingModel.(Conventions|Output|).*</TypeExclusionPatterns>
+ <MethodExclusionPatterns>.*\.Add.*</MethodExclusionPatterns>
+ <MethodExclusionPatterns>.*\.AcceptVisitor</MethodExclusionPatterns>
+ <MethodExclusionPatterns>.*\.I.*Inspector\..*</MethodExclusionPatterns>
+ <Assemblies>FluentNHibernate</Assemblies>
+ <IncludedClassNames>FluentNHibernate.Conventions.DslImplementation.*</IncludedClassNames>
+ <IncludedClassNames>FluentNHibernate.Conventions.Alterations.*</IncludedClassNames>
+ <IncludedClassNames>FluentNHibernate.MappingModel.*</IncludedClassNames>
+ <LogFile>coverage.log</LogFile>
+ <LoggingLevel>None</LoggingLevel>
+ <NCoverExe>C:\Program Files\NCover\ncover.console.exe</NCoverExe>
+ <ProfileIIS>false</ProfileIIS>
+ <ProfileWindowsApplication>true</ProfileWindowsApplication>
+ <ProfileWindowsService>false</ProfileWindowsService>
+ <ProjectName>New Project</ProjectName>
+ <RegisterForUser>true</RegisterForUser>
+ <ServiceTimeout>0</ServiceTimeout>
+ <SymbolSearchPolicy>12</SymbolSearchPolicy>
+ <VersionNumber>158</VersionNumber>
+ <WaitForAppLoad>1</WaitForAppLoad>
+ <WorkingDirectory>C:\Documents and Settings\Administrator\dev\fluent-nhibernate\src\FluentNHibernate.Testing\bin\x86\Debug</WorkingDirectory>
+ </NCoverRunSettings>
+ <ProjectGuid>19d27372-881d-4a6d-b83c-c832f4bcab50</ProjectGuid>
+ <ProjectName>New Project</ProjectName>
+ <RebasedPaths>
+ <Path>
+ <RebasedPath>c:\documents and settings\administrator\dev\fluent-nhibernate\src\fluentnhibernate\conventions\dslimplementation\columndsl.cs</RebasedPath>
+ <SourcePath>c:\documents and settings\administrator\dev\fluent-nhibernate\src\fluentnhibernate\conventions\dslimplementation\columndsl.cs</SourcePath>
+ </Path>
+ </RebasedPaths>
+ <ReportPath />
+ <SyncPathWithWorkingDirectory>false</SyncPathWithWorkingDirectory>
+</NCover3ProjectSetting>
@@ -26,7 +26,7 @@ public void CollectionIsEmptyShouldBeTrueWhenUsingExpression()
.Expect(x => x.Columns.IsEmpty());
acceptance
- .Matches(new PropertyDsl(new PropertyMapping()))
+ .Matches(new PropertyInspector(new PropertyMapping()))
.ShouldBeTrue();
}
@@ -40,7 +40,7 @@ public void CollectionIsEmptyShouldBeFalseWithItemsWhenUsingExpression()
mapping.AddColumn(new ColumnMapping { Name = "Column1" });
acceptance
- .Matches(new PropertyDsl(mapping))
+ .Matches(new PropertyInspector(mapping))
.ShouldBeFalse();
}
@@ -51,7 +51,7 @@ public void CollectionIsNotEmptyShouldBeFalseWhenUsingExpression()
.Expect(x => x.Columns.IsNotEmpty());
acceptance
- .Matches(new PropertyDsl(new PropertyMapping()))
+ .Matches(new PropertyInspector(new PropertyMapping()))
.ShouldBeFalse();
}
@@ -65,7 +65,7 @@ public void CollectionIsNotEmptyShouldBeTrueWithItemsWhenUsingExpression()
mapping.AddColumn(new ColumnMapping { Name = "Column1" });
acceptance
- .Matches(new PropertyDsl(mapping))
+ .Matches(new PropertyInspector(mapping))
.ShouldBeTrue();
}
@@ -79,7 +79,7 @@ public void CollectionContainsWithStringShouldBeFalseWhenNoItemsMatching()
mapping.AddColumn(new ColumnMapping { Name = "Column1" });
acceptance
- .Matches(new PropertyDsl(mapping))
+ .Matches(new PropertyInspector(mapping))
.ShouldBeFalse();
}
@@ -93,7 +93,7 @@ public void CollectionContainsWithStringShouldBeTrueWhenItemsMatching()
mapping.AddColumn(new ColumnMapping { Name = "Column1" });
acceptance
- .Matches(new PropertyDsl(mapping))
+ .Matches(new PropertyInspector(mapping))
.ShouldBeTrue();
}
@@ -107,7 +107,7 @@ public void CollectionContainsWithLambdaShouldBeFalseWhenNoItemsMatching()
mapping.AddColumn(new ColumnMapping { Name = "Column1" });
acceptance
- .Matches(new PropertyDsl(mapping))
+ .Matches(new PropertyInspector(mapping))
.ShouldBeFalse();
}
@@ -121,7 +121,7 @@ public void CollectionContainsWithLambdaShouldBeTrueWhenItemsMatching()
mapping.AddColumn(new ColumnMapping { Name = "Column1" });
acceptance
- .Matches(new PropertyDsl(mapping))
+ .Matches(new PropertyInspector(mapping))
.ShouldBeTrue();
}
}
@@ -24,7 +24,7 @@ public void ExpectEqualShouldValidateToTrueIfGivenMatchingModel()
acceptance.Expect(x => x.Access == Access.AsField());
acceptance
- .Matches(new PropertyDsl(new PropertyMapping() { Access = "field" }))
+ .Matches(new PropertyInspector(new PropertyMapping() { Access = "field" }))
.ShouldBeTrue();
}
@@ -34,7 +34,7 @@ public void ExpectEqualShouldValidateToFalseIfNotGivenMatchingModel()
acceptance.Expect(x => x.Access == Access.AsField());
acceptance
- .Matches(new PropertyDsl(new PropertyMapping() { Access = "property" }))
+ .Matches(new PropertyInspector(new PropertyMapping() { Access = "property" }))
.ShouldBeFalse();
}
@@ -44,7 +44,7 @@ public void ExpectEqualShouldValidateToFalseIfUnset()
acceptance.Expect(x => x.Access == Access.AsField());
acceptance
- .Matches(new PropertyDsl(new PropertyMapping()))
+ .Matches(new PropertyInspector(new PropertyMapping()))
.ShouldBeFalse();
}
@@ -54,7 +54,7 @@ public void ExpectNotEqualShouldValidateToTrueIfGivenMatchingModel()
acceptance.Expect(x => x.Access != Access.AsField());
acceptance
- .Matches(new PropertyDsl(new PropertyMapping() { Access = "property" }))
+ .Matches(new PropertyInspector(new PropertyMapping() { Access = "property" }))
.ShouldBeTrue();
}
@@ -64,7 +64,7 @@ public void ExpectNotEqualShouldValidateToFalseIfNotGivenMatchingModel()
acceptance.Expect(x => x.Access != Access.AsField());
acceptance
- .Matches(new PropertyDsl(new PropertyMapping() { Access = "field" }))
+ .Matches(new PropertyInspector(new PropertyMapping() { Access = "field" }))
.ShouldBeFalse();
}
@@ -74,7 +74,7 @@ public void ExpectNotEqualShouldValidateToTrueIfUnset()
acceptance.Expect(x => x.Access != Access.AsField());
acceptance
- .Matches(new PropertyDsl(new PropertyMapping()))
+ .Matches(new PropertyInspector(new PropertyMapping()))
.ShouldBeTrue();
}
}
@@ -23,7 +23,7 @@ public void ExpectEqualShouldValidateToTrueIfGivenMatchingModel()
acceptance.Expect(x => x.Insert == true);
acceptance
- .Matches(new PropertyDsl(new PropertyMapping() { Insert = true }))
+ .Matches(new PropertyInspector(new PropertyMapping() { Insert = true }))
.ShouldBeTrue();
}
@@ -33,7 +33,7 @@ public void ExpectEqualShouldValidateToFalseIfNotGivenMatchingModel()
acceptance.Expect(x => x.Insert == true);
acceptance
- .Matches(new PropertyDsl(new PropertyMapping() { Insert = false }))
+ .Matches(new PropertyInspector(new PropertyMapping() { Insert = false }))
.ShouldBeFalse();
}
@@ -43,7 +43,7 @@ public void ExpectEqualShouldValidateToFalseIfUnset()
acceptance.Expect(x => x.Insert == true);
acceptance
- .Matches(new PropertyDsl(new PropertyMapping()))
+ .Matches(new PropertyInspector(new PropertyMapping()))
.ShouldBeFalse();
}
@@ -53,7 +53,7 @@ public void ExpectNotEqualShouldValidateToTrueIfGivenMatchingModel()
acceptance.Expect(x => x.Insert != true);
acceptance
- .Matches(new PropertyDsl(new PropertyMapping() { Insert = false }))
+ .Matches(new PropertyInspector(new PropertyMapping() { Insert = false }))
.ShouldBeTrue();
}
@@ -63,7 +63,7 @@ public void ExpectNotEqualShouldValidateToFalseIfNotGivenMatchingModel()
acceptance.Expect(x => x.Insert != true);
acceptance
- .Matches(new PropertyDsl(new PropertyMapping() { Insert = true }))
+ .Matches(new PropertyInspector(new PropertyMapping() { Insert = true }))
.ShouldBeFalse();
}
@@ -73,7 +73,7 @@ public void ExpectNotEqualShouldValidateToTrueIfUnset()
acceptance.Expect(x => x.Insert != true);
acceptance
- .Matches(new PropertyDsl(new PropertyMapping()))
+ .Matches(new PropertyInspector(new PropertyMapping()))
.ShouldBeTrue();
}
}
@@ -25,7 +25,7 @@ public void ExpectEqualShouldValidateToTrueIfGivenMatchingModel()
acceptance.Expect(x => x.Insert == true);
acceptance
- .Matches(new PropertyDsl(new PropertyMapping() { Insert = true }))
+ .Matches(new PropertyInspector(new PropertyMapping() { Insert = true }))
.ShouldBeTrue();
}
@@ -35,7 +35,7 @@ public void ExpectEqualShouldValidateToFalseIfNotGivenMatchingModel()
acceptance.Expect(x => x.Insert == true);
acceptance
- .Matches(new PropertyDsl(new PropertyMapping() { Insert = false }))
+ .Matches(new PropertyInspector(new PropertyMapping() { Insert = false }))
.ShouldBeFalse();
}
@@ -45,7 +45,7 @@ public void ExpectEqualShouldValidateToFalseIfUnset()
acceptance.Expect(x => x.Insert == true);
acceptance
- .Matches(new PropertyDsl(new PropertyMapping()))
+ .Matches(new PropertyInspector(new PropertyMapping()))
.ShouldBeFalse();
}
@@ -55,7 +55,7 @@ public void ExpectNotEqualShouldValidateToTrueIfGivenMatchingModel()
acceptance.Expect(x => x.Insert != true);
acceptance
- .Matches(new PropertyDsl(new PropertyMapping() { Insert = false }))
+ .Matches(new PropertyInspector(new PropertyMapping() { Insert = false }))
.ShouldBeTrue();
}
@@ -65,7 +65,7 @@ public void ExpectNotEqualShouldValidateToFalseIfNotGivenMatchingModel()
acceptance.Expect(x => x.Insert != true);
acceptance
- .Matches(new PropertyDsl(new PropertyMapping() { Insert = true }))
+ .Matches(new PropertyInspector(new PropertyMapping() { Insert = true }))
.ShouldBeFalse();
}
@@ -75,7 +75,7 @@ public void ExpectNotEqualShouldValidateToTrueIfUnset()
acceptance.Expect(x => x.Insert != true);
acceptance
- .Matches(new PropertyDsl(new PropertyMapping()))
+ .Matches(new PropertyInspector(new PropertyMapping()))
.ShouldBeTrue();
}
}
@@ -25,7 +25,7 @@ public void ExpectShouldEvaluateSubPropertyWithEvaluation()
{
acceptance.Expect(x => x.Type.Name == typeof(int).Name);
- acceptance.Matches(new PropertyDsl(new PropertyMapping { PropertyInfo = ReflectionHelper.GetProperty<Record>(x => x.Age) }))
+ acceptance.Matches(new PropertyInspector(new PropertyMapping { PropertyInfo = ReflectionHelper.GetProperty<Record>(x => x.Age) }))
.ShouldBeTrue();
}
}
@@ -36,7 +36,7 @@ public void ShouldUseInheritedCriteria()
acceptance
.SameAs<AnotherConvention>();
- acceptance.Matches(new PropertyDsl(new PropertyMapping
+ acceptance.Matches(new PropertyInspector(new PropertyMapping
{
Insert = false,
Update = false
@@ -60,7 +60,7 @@ public void ShouldUseInheritedOppositeCriteria()
acceptance
.OppositeOf<AnotherConvention>();
- acceptance.Matches(new PropertyDsl(new PropertyMapping
+ acceptance.Matches(new PropertyInspector(new PropertyMapping
{
Insert = true,
Update = true
Oops, something went wrong.

0 comments on commit bb50da5

Please sign in to comment.