Skip to content

Commit

Permalink
deleted the unneccesary file
Browse files Browse the repository at this point in the history
  • Loading branch information
chester89 committed Aug 15, 2012
1 parent 0a2cb93 commit 0411f6b
Show file tree
Hide file tree
Showing 3 changed files with 51 additions and 64 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -414,7 +414,6 @@
<Compile Include="Utils\TypeReferenceEqualityTests.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Visitors\ComponentColumnPrefixVisitorSpecs.cs" />
<Compile Include="Visitors\ComponentColumnPrefixVisitorSpecs2.cs" />
<Compile Include="Visitors\ComponentReferenceResolutionVisitorSpecs.cs" />
<Compile Include="Xml\MappingXmlTestHelper.cs" />
</ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,57 @@ public void should_prefix_property_columns()
}
}

[TestFixture]
public class when_the_component_column_prefix_visitor_processes_a_component_with_a_prefix_using_field_alias : ComponentColumnPrefixVisitorSpec
{
PersistenceModel model;
IEnumerable<HibernateMapping> mappings;
ClassMapping targetMapping;
const string columnPrefix = "{property}";

public override void establish_context()
{
model = new PersistenceModel();

var componentMap = new ComponentMap<FieldComponent>();
componentMap.Map(x => x.X);
componentMap.Map(x => x.Y);

model.Add(componentMap);

var classMapping = new ClassMap<Root>();
classMapping.Id(r => r.Id);
classMapping.Component(Reveal.Member<Root, FieldComponent>("component"), cpt => cpt.Access.Field().ColumnPrefix(columnPrefix));
model.Add(classMapping);
}

public override void because()
{
mappings = model.BuildMappings().ToList();
targetMapping = mappings.SelectMany(x => x.Classes).FirstOrDefault(x => x.Type == typeof(Root));
}

[Test]
public void should_prefix_field_columns()
{
targetMapping.Components.Single()
.Properties.SelectMany(x => x.Columns)
.Each(c => c.Name.ShouldStartWith("component"));
}
}

class Root
{
FieldComponent component;
public int Id { get; set; }
}

class FieldComponent
{
public string X { get; set; }
public int? Y { get; set; }
}

public abstract class ComponentColumnPrefixVisitorSpec : Specification
{
protected AnyMapping any_with_column(string column)
Expand Down

This file was deleted.

0 comments on commit 0411f6b

Please sign in to comment.