Skip to content

Commit 781ebf5

Browse files
Ignitionchester89
authored andcommitted
Removed unneeded abstract class and fixed naming of variables
1 parent 24af69b commit 781ebf5

File tree

1 file changed

+26
-29
lines changed

1 file changed

+26
-29
lines changed

src/FluentNHibernate.Testing/Visitors/RelationshipPairingVisitorSpec.cs

Lines changed: 26 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -7,54 +7,51 @@
77

88
namespace FluentNHibernate.Testing.Visitors
99
{
10-
public abstract class RelationshipPairingVisitorSpec : Specification
10+
[TestFixture]
11+
public class when_the_relationship_pairing_visitor_visits_with_multiple_many_to_one_mapping_references : Specification
1112
{
1213
protected RelationshipPairingVisitor visitor;
13-
protected CollectionMapping collectionMappingToZ;
14-
protected ManyToOneMapping manyToOneZToHolder;
15-
protected ManyToOneMapping manyToOneYToHolder;
16-
}
14+
protected CollectionMapping collectionMappingToBRankedSecond;
15+
protected ManyToOneMapping manyToOneBRankedSecondToHolder;
16+
protected ManyToOneMapping manyToOneARankedFirstToHolder;
1717

18-
[TestFixture]
19-
public class when_the_relationship_pairing_visitor_visits_with_multiple_many_to_one_mapping_references : RelationshipPairingVisitorSpec
20-
{
2118
public override void establish_context()
2219
{
23-
manyToOneYToHolder = new ManyToOneMapping();
24-
manyToOneYToHolder.Set(x => x.Class, Layer.Defaults, new TypeReference(typeof(Holder)));
25-
manyToOneYToHolder.Set(x => x.Name, Layer.Defaults, "ARankedFirstProperty");
26-
manyToOneYToHolder.ContainingEntityType = typeof(ARankedFirst);
27-
manyToOneYToHolder.Member = new PropertyMember(typeof(ARankedFirst).GetProperty("ARankedFirstProperty"));
28-
29-
manyToOneZToHolder = new ManyToOneMapping();
30-
manyToOneZToHolder.Set(x => x.Class, Layer.Defaults, new TypeReference(typeof(Holder)));
31-
manyToOneZToHolder.Set(x => x.Name, Layer.Defaults, "BRankedSecondProperty");
32-
manyToOneZToHolder.ContainingEntityType = typeof(BRankedSecond);
33-
manyToOneZToHolder.Member = new PropertyMember(typeof(BRankedSecond).GetProperty("BRankedSecondProperty"));
20+
manyToOneARankedFirstToHolder = new ManyToOneMapping();
21+
manyToOneARankedFirstToHolder.Set(x => x.Class, Layer.Defaults, new TypeReference(typeof(Holder)));
22+
manyToOneARankedFirstToHolder.Set(x => x.Name, Layer.Defaults, "ARankedFirstProperty");
23+
manyToOneARankedFirstToHolder.ContainingEntityType = typeof(ARankedFirst);
24+
manyToOneARankedFirstToHolder.Member = new PropertyMember(typeof(ARankedFirst).GetProperty("ARankedFirstProperty"));
25+
26+
manyToOneBRankedSecondToHolder = new ManyToOneMapping();
27+
manyToOneBRankedSecondToHolder.Set(x => x.Class, Layer.Defaults, new TypeReference(typeof(Holder)));
28+
manyToOneBRankedSecondToHolder.Set(x => x.Name, Layer.Defaults, "BRankedSecondProperty");
29+
manyToOneBRankedSecondToHolder.ContainingEntityType = typeof(BRankedSecond);
30+
manyToOneBRankedSecondToHolder.Member = new PropertyMember(typeof(BRankedSecond).GetProperty("BRankedSecondProperty"));
3431

3532
var relationship = new OneToManyMapping();
3633
relationship.Set(x => x.Class, Layer.Defaults, new TypeReference(typeof(BRankedSecond)));
3734
relationship.ContainingEntityType = typeof(Holder);
3835

39-
collectionMappingToZ = CollectionMapping.Bag();
40-
collectionMappingToZ.Set(x => x.ChildType, Layer.Defaults, typeof(BRankedSecond));
41-
collectionMappingToZ.Set(x => x.Name, Layer.Defaults, "ColectionOfBRankedSeconds");
42-
collectionMappingToZ.Set(x => x.Relationship, Layer.Defaults, relationship);
43-
collectionMappingToZ.ContainingEntityType = typeof(Holder);
36+
collectionMappingToBRankedSecond = CollectionMapping.Bag();
37+
collectionMappingToBRankedSecond.Set(x => x.ChildType, Layer.Defaults, typeof(BRankedSecond));
38+
collectionMappingToBRankedSecond.Set(x => x.Name, Layer.Defaults, "ColectionOfBRankedSeconds");
39+
collectionMappingToBRankedSecond.Set(x => x.Relationship, Layer.Defaults, relationship);
40+
collectionMappingToBRankedSecond.ContainingEntityType = typeof(Holder);
4441

4542
visitor = new RelationshipPairingVisitor(A.Fake<PairBiDirectionalManyToManySidesDelegate>());
4643
}
4744

4845
[Test]
4946
public void should_associate_the_collection_mapping_to_the_correct_type()
5047
{
51-
visitor.ProcessCollection(collectionMappingToZ);
52-
visitor.ProcessManyToOne(manyToOneYToHolder);
53-
visitor.ProcessManyToOne(manyToOneZToHolder);
48+
visitor.ProcessCollection(collectionMappingToBRankedSecond);
49+
visitor.ProcessManyToOne(manyToOneARankedFirstToHolder);
50+
visitor.ProcessManyToOne(manyToOneBRankedSecondToHolder);
5451
visitor.Visit(Enumerable.Empty<HibernateMapping>());
5552

56-
var otherSide = (ManyToOneMapping)collectionMappingToZ.OtherSide;
53+
var otherSide = (ManyToOneMapping)collectionMappingToBRankedSecond.OtherSide;
5754
otherSide.ContainingEntityType.ShouldEqual(typeof(BRankedSecond));
5855
}
5956
}
60-
}
57+
}

0 commit comments

Comments
 (0)