Skip to content

Commit bd94ea5

Browse files
committed
Added tests verifying inability to use multiple assemblies for overrides
1 parent 3dd538a commit bd94ea5

16 files changed

+185
-12
lines changed
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
namespace FluentNHibernate.Specs.ExternalFixtures
2+
{
3+
public class Component {}
4+
}

src/FluentNHibernate.Specs/Automapping/Fixtures/Entity.cs renamed to src/FluentNHibernate.Specs.ExternalFixtures/Entity.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
using System.Collections.Generic;
22

3-
namespace FluentNHibernate.Specs.Automapping.Fixtures
3+
namespace FluentNHibernate.Specs.ExternalFixtures
44
{
5-
class Entity
5+
public class Entity
66
{
77
EntityChild readOnlyChild;
88

@@ -13,15 +13,15 @@ class Entity
1313
public IList<EntityChild> Children { get; set; }
1414
public Component Component { get; set; }
1515

16-
internal enum TestEnum {}
16+
public enum TestEnum {}
1717

1818
public EntityChild ReadOnlyChild
1919
{
2020
get { return readOnlyChild; }
2121
}
2222
}
2323

24-
class EntityChild
24+
public class EntityChild
2525
{}
2626

2727
public abstract class A_Child : B_Parent
Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
<PropertyGroup>
4+
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
5+
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
6+
<ProductVersion>8.0.30703</ProductVersion>
7+
<SchemaVersion>2.0</SchemaVersion>
8+
<ProjectGuid>{28BF853D-5B20-4091-A059-1CB0A028F981}</ProjectGuid>
9+
<OutputType>Library</OutputType>
10+
<AppDesignerFolder>Properties</AppDesignerFolder>
11+
<RootNamespace>FluentNHibernate.Specs.ExternalFixtures</RootNamespace>
12+
<AssemblyName>FluentNHibernate.Specs.ExternalFixtures</AssemblyName>
13+
<TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
14+
<FileAlignment>512</FileAlignment>
15+
<TargetFrameworkProfile />
16+
</PropertyGroup>
17+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
18+
<DebugSymbols>true</DebugSymbols>
19+
<DebugType>full</DebugType>
20+
<Optimize>false</Optimize>
21+
<OutputPath>bin\Debug\</OutputPath>
22+
<DefineConstants>DEBUG;TRACE</DefineConstants>
23+
<ErrorReport>prompt</ErrorReport>
24+
<WarningLevel>4</WarningLevel>
25+
</PropertyGroup>
26+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
27+
<DebugType>pdbonly</DebugType>
28+
<Optimize>true</Optimize>
29+
<OutputPath>bin\Release\</OutputPath>
30+
<DefineConstants>TRACE</DefineConstants>
31+
<ErrorReport>prompt</ErrorReport>
32+
<WarningLevel>4</WarningLevel>
33+
</PropertyGroup>
34+
<ItemGroup>
35+
<Reference Include="NHibernate">
36+
<HintPath>..\..\tools\NHibernate\NHibernate.dll</HintPath>
37+
</Reference>
38+
<Reference Include="System" />
39+
<Reference Include="System.Core" />
40+
<Reference Include="System.Xml.Linq" />
41+
<Reference Include="System.Data.DataSetExtensions" />
42+
<Reference Include="Microsoft.CSharp" />
43+
<Reference Include="System.Data" />
44+
<Reference Include="System.Xml" />
45+
</ItemGroup>
46+
<ItemGroup>
47+
<Compile Include="Component.cs" />
48+
<Compile Include="Entity.cs" />
49+
<Compile Include="Overrides\EntityBatchSizeOverride.cs" />
50+
<Compile Include="Properties\AssemblyInfo.cs" />
51+
</ItemGroup>
52+
<ItemGroup>
53+
<ProjectReference Include="..\FluentNHibernate\FluentNHibernate.csproj">
54+
<Project>{529145D5-6CC3-4016-89B5-826563024AF1}</Project>
55+
<Name>FluentNHibernate</Name>
56+
</ProjectReference>
57+
</ItemGroup>
58+
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
59+
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
60+
Other similar extension points exist, see Microsoft.Common.targets.
61+
<Target Name="BeforeBuild">
62+
</Target>
63+
<Target Name="AfterBuild">
64+
</Target>
65+
-->
66+
</Project>
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
using FluentNHibernate.Automapping;
2+
using FluentNHibernate.Automapping.Alterations;
3+
4+
namespace FluentNHibernate.Specs.ExternalFixtures.Overrides
5+
{
6+
public class EntityBatchSizeOverride : IAutoMappingOverride<Entity>
7+
{
8+
public void Override(AutoMapping<Entity> mapping)
9+
{
10+
mapping.BatchSize(1234);
11+
}
12+
}
13+
}
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
using System.Reflection;
2+
using System.Runtime.CompilerServices;
3+
using System.Runtime.InteropServices;
4+
5+
// General Information about an assembly is controlled through the following
6+
// set of attributes. Change these attribute values to modify the information
7+
// associated with an assembly.
8+
[assembly: AssemblyTitle("FluentNHibernate.Specs.ExternalFixtures")]
9+
[assembly: AssemblyDescription("")]
10+
[assembly: AssemblyConfiguration("")]
11+
[assembly: AssemblyCompany("Microsoft")]
12+
[assembly: AssemblyProduct("FluentNHibernate.Specs.ExternalFixtures")]
13+
[assembly: AssemblyCopyright("Copyright © Microsoft 2011")]
14+
[assembly: AssemblyTrademark("")]
15+
[assembly: AssemblyCulture("")]
16+
17+
// Setting ComVisible to false makes the types in this assembly not visible
18+
// to COM components. If you need to access a type in this assembly from
19+
// COM, set the ComVisible attribute to true on that type.
20+
[assembly: ComVisible(false)]
21+
22+
// The following GUID is for the ID of the typelib if this project is exposed to COM
23+
[assembly: Guid("791590fa-5db6-4e34-8a96-7a4ed51fe714")]
24+
25+
// Version information for an assembly consists of the following four values:
26+
//
27+
// Major Version
28+
// Minor Version
29+
// Build Number
30+
// Revision
31+
//
32+
// You can specify all the values or you can default the Build and Revision Numbers
33+
// by using the '*' as shown below:
34+
// [assembly: AssemblyVersion("1.0.*")]
35+
[assembly: AssemblyVersion("1.0.0.0")]
36+
[assembly: AssemblyFileVersion("1.0.0.0")]

src/FluentNHibernate.Specs/Automapping/AutoPersistenceModelSpecs.Conventions.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
using FluentNHibernate.Conventions.Inspections;
55
using FluentNHibernate.Conventions.Instances;
66
using FluentNHibernate.Specs.Automapping.Fixtures;
7+
using FluentNHibernate.Specs.ExternalFixtures;
78
using Machine.Specifications;
89

910
namespace FluentNHibernate.Specs.Automapping

src/FluentNHibernate.Specs/Automapping/AutoPersistenceModelSpecs.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
using FluentNHibernate.MappingModel;
99
using FluentNHibernate.MappingModel.ClassBased;
1010
using FluentNHibernate.Specs.Automapping.Fixtures;
11+
using FluentNHibernate.Specs.ExternalFixtures;
1112
using Machine.Specifications;
1213

1314
namespace FluentNHibernate.Specs.Automapping

src/FluentNHibernate.Specs/Automapping/AutomappingSpecs.Components.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
using FluentNHibernate.Automapping;
55
using FluentNHibernate.MappingModel.ClassBased;
66
using FluentNHibernate.Specs.Automapping.Fixtures;
7+
using FluentNHibernate.Specs.ExternalFixtures;
78
using FluentNHibernate.Utils;
89
using Machine.Specifications;
910

src/FluentNHibernate.Specs/Automapping/Fixtures/Component.cs

Lines changed: 0 additions & 4 deletions
This file was deleted.

src/FluentNHibernate.Specs/Automapping/Fixtures/DictionaryEntity.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
using System.Collections;
22
using System.Collections.Generic;
3+
using FluentNHibernate.Specs.ExternalFixtures;
34

45
namespace FluentNHibernate.Specs.Automapping.Fixtures
56
{

0 commit comments

Comments
 (0)