Skip to content

Commit

Permalink
init
Browse files Browse the repository at this point in the history
  • Loading branch information
schneidenbach committed Dec 16, 2015
1 parent b6957f6 commit ddd03ff
Show file tree
Hide file tree
Showing 31 changed files with 868 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{2807F09B-76C0-4C60-A13C-81ADED284CF2}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>AutoMapper.Attributes.Tests.TestAssembly</RootNamespace>
<AssemblyName>AutoMapper.Attributes.Tests.TestAssembly</AssemblyName>
<TargetFrameworkVersion>v4.5.2</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="AutoMapper, Version=4.0.0.0, Culture=neutral, PublicKeyToken=be96cd2c38ef1005, processorArchitecture=MSIL">
<HintPath>..\packages\AutoMapper.4.0.0\lib\net45\AutoMapper.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Net.Http" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="MapsFromTests\SourceData.cs" />
<Compile Include="MapsFromTests\SourceDataNormalAttribute.cs" />
<Compile Include="MapsFromTests\SourceDataSpecialAttribute.cs" />
<Compile Include="MapsFromTests\MapsFromSourceDataNormalAttribute.cs" />
<Compile Include="MapsFromTests\MapsFromSourceDataSpecialAttribute.cs" />
<Compile Include="MapsFromTests\DestinationData.cs" />
<Compile Include="MapsToTests\DestinationDataNormalAttribute.cs" />
<Compile Include="MapsToTests\DestinationDataSpecialAttribute.cs" />
<Compile Include="MapsToTests\MapsToDestinationDataNormalAttribute.cs" />
<Compile Include="MapsToTests\MapsToDestinationDataSpecialAttribute.cs" />
<Compile Include="MapsToTests\SourceData.cs" />
<Compile Include="MapsToTests\DestinationData.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\AutoMapper.Attributes\AutoMapper.Attributes.csproj">
<Project>{a6f71cab-79cf-4a13-95d5-499ecc89c986}</Project>
<Name>AutoMapper.Attributes</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<None Include="packages.config" />
</ItemGroup>
<ItemGroup />
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
namespace AutoMapper.Attributes.Tests.TestAssembly.MapsFromTests
{
[MapsFrom(typeof(SourceData))]
[MapsFromSourceDataNormal]
[MapsFromSourceDataSpecial]
public class DestinationData
{
public string Name { get; set; }
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
namespace AutoMapper.Attributes.Tests.TestAssembly.MapsFromTests
{
public class MapsFromSourceDataNormalAttribute : MapsFromAttribute
{
public MapsFromSourceDataNormalAttribute() : base(typeof(SourceDataNormalAttribute))
{
}

public override void ConfigureMapping(IMappingExpression mappingExpression)
{
mappingExpression.ForMember(nameof(DestinationData.Name), expression => expression.MapFrom(nameof(SourceDataNormalAttribute.YetAnotherName)));
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
namespace AutoMapper.Attributes.Tests.TestAssembly.MapsFromTests
{
public class MapsFromSourceDataSpecialAttribute : MapsFromAttribute
{
public MapsFromSourceDataSpecialAttribute() : base(typeof(SourceDataSpecialAttribute))
{
}

public void ConfigureMapping(IMappingExpression<SourceDataSpecialAttribute, DestinationData> mappingExpression)
{
mappingExpression.ForMember(d => d.Name, expression => expression.MapFrom(s => s.AnotherName));
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
namespace AutoMapper.Attributes.Tests.TestAssembly.MapsFromTests
{
public class SourceData
{
public string Name { get; set; }
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
namespace AutoMapper.Attributes.Tests.TestAssembly.MapsFromTests
{
public class SourceDataNormalAttribute
{
public string YetAnotherName { get; set; }
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
namespace AutoMapper.Attributes.Tests.TestAssembly.MapsFromTests
{
public class SourceDataSpecialAttribute
{
public string AnotherName { get; set; }
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
namespace AutoMapper.Attributes.Tests.TestAssembly.MapsToTests
{
public class DestinationData
{
public string Name { get; set; }
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
namespace AutoMapper.Attributes.Tests.TestAssembly.MapsToTests
{
public class DestinationDataNormalAttribute
{
public string YetAnotherName { get; set; }
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
namespace AutoMapper.Attributes.Tests.TestAssembly.MapsToTests
{
public class DestinationDataSpecialAttribute
{
public string AnotherName { get; set; }
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
namespace AutoMapper.Attributes.Tests.TestAssembly.MapsToTests
{
public class MapsToDestinationDataNormalAttribute : MapsToAttribute
{
public MapsToDestinationDataNormalAttribute() : base(typeof(DestinationDataNormalAttribute))
{
}

public override void ConfigureMapping(IMappingExpression mappingExpression)
{
mappingExpression.ForMember(nameof(DestinationDataNormalAttribute.YetAnotherName), expression => expression.MapFrom(nameof(SourceData.Name)));
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
namespace AutoMapper.Attributes.Tests.TestAssembly.MapsToTests
{
public class MapsToDestinationDataSpecialAttribute : MapsToAttribute
{
public MapsToDestinationDataSpecialAttribute() : base(typeof(DestinationDataSpecialAttribute))
{
}

public void ConfigureMapping(IMappingExpression<SourceData, DestinationDataSpecialAttribute> mappingExpression)
{
mappingExpression.ForMember(d => d.AnotherName, expression => expression.MapFrom(s => s.Name));
}
}
}
10 changes: 10 additions & 0 deletions AutoMapper.Attributes.Tests.TestAssembly/MapsToTests/SourceData.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
namespace AutoMapper.Attributes.Tests.TestAssembly.MapsToTests
{
[MapsTo(typeof(DestinationData))]
[MapsToDestinationDataSpecial]
[MapsToDestinationDataNormal]
public class SourceData
{
public string Name { get; set; }
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;

// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("AutoMapper.Attributes.Tests.TestAssembly")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("AutoMapper.Attributes.Tests.TestAssembly")]
[assembly: AssemblyCopyright("Copyright © 2015")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]

// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]

// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("2807f09b-76c0-4c60-a13c-81aded284cf2")]

// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
4 changes: 4 additions & 0 deletions AutoMapper.Attributes.Tests.TestAssembly/packages.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="AutoMapper" version="4.0.0" targetFramework="net452" />
</packages>
77 changes: 77 additions & 0 deletions AutoMapper.Attributes.Tests/AutoMapper.Attributes.Tests.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{B64D9F5E-798E-40D0-903A-922D0D1D0480}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>AutoMapper.Attributes.Tests</RootNamespace>
<AssemblyName>AutoMapper.Attributes.Tests</AssemblyName>
<TargetFrameworkVersion>v4.5.2</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="AutoMapper, Version=4.0.0.0, Culture=neutral, PublicKeyToken=be96cd2c38ef1005, processorArchitecture=MSIL">
<HintPath>..\packages\AutoMapper.4.0.0\lib\net45\AutoMapper.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="nunit.framework, Version=2.6.4.14350, Culture=neutral, PublicKeyToken=96d09a1eb7f44a77, processorArchitecture=MSIL">
<HintPath>..\packages\NUnit.2.6.4\lib\nunit.framework.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Net.Http" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="MapsFromTests.cs" />
<Compile Include="MapsToTests.cs" />
<Compile Include="MapTests.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<None Include="packages.config" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\AutoMapper.Attributes.Tests.TestAssembly\AutoMapper.Attributes.Tests.TestAssembly.csproj">
<Project>{2807f09b-76c0-4c60-a13c-81aded284cf2}</Project>
<Name>AutoMapper.Attributes.Tests.TestAssembly</Name>
</ProjectReference>
<ProjectReference Include="..\AutoMapper.Attributes\AutoMapper.Attributes.csproj">
<Project>{a6f71cab-79cf-4a13-95d5-499ecc89c986}</Project>
<Name>AutoMapper.Attributes</Name>
</ProjectReference>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>
18 changes: 18 additions & 0 deletions AutoMapper.Attributes.Tests/MapTests.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
using AutoMapper.Attributes.Tests.TestAssembly.MapsFromTests;
using NUnit.Framework;

namespace AutoMapper.Attributes.Tests
{
[TestFixture]
public abstract class MapTests
{
protected const string Grandma = "Grandma";

[SetUp]
public void Setup()
{
typeof(SourceData).Assembly.MapTypes();
}

}
}
Loading

0 comments on commit ddd03ff

Please sign in to comment.