Skip to content

Commit ef3d2db

Browse files
Merge pull request #93 from AutoMapper/development
Update to Master from Development
2 parents aa74882 + 9a47023 commit ef3d2db

26 files changed

+380
-301
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -192,3 +192,4 @@ ModelManifest.xml
192192
*.GhostDoc.xml
193193
/artifacts
194194
*.lock.json
195+
/results

AutoMapper.Collection.sln

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11

22
Microsoft Visual Studio Solution File, Format Version 12.00
33
# Visual Studio 15
4-
VisualStudioVersion = 15.0.26430.6
4+
VisualStudioVersion = 15.0.27130.2010
55
MinimumVisualStudioVersion = 10.0.40219.1
66
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".nuget", ".nuget", "{19AAEE83-5EEC-4EAA-9CF7-16F8ED58B50E}"
77
ProjectSection(SolutionItems) = preProject
@@ -10,8 +10,10 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".nuget", ".nuget", "{19AAEE
1010
EndProject
1111
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{578F2483-CF08-409D-A316-31BCB7C5D9D0}"
1212
ProjectSection(SolutionItems) = preProject
13+
Directory.Build.props = Directory.Build.props
1314
global.json = global.json
1415
README.md = README.md
16+
version.props = version.props
1517
EndProjectSection
1618
EndProject
1719
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AutoMapper.Collection", "src\AutoMapper.Collection\AutoMapper.Collection.csproj", "{37AD667A-8080-476C-88FD-20310AC7CAF3}"
@@ -54,4 +56,7 @@ Global
5456
GlobalSection(SolutionProperties) = preSolution
5557
HideSolutionNode = FALSE
5658
EndGlobalSection
59+
GlobalSection(ExtensibilityGlobals) = postSolution
60+
SolutionGuid = {D5C8CD86-1F3F-4D3A-8A90-5F3726E8F998}
61+
EndGlobalSection
5762
EndGlobal

Directory.Build.props

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<Project>
2+
<Import Project="version.props" />
3+
4+
<PropertyGroup>
5+
<FluentAssertions>4.15.0</FluentAssertions>
6+
<TestSDKVersion>15.5.0</TestSDKVersion>
7+
<xUnitVersion>2.3.1</xUnitVersion>
8+
</PropertyGroup>
9+
</Project>

build.ps1

Lines changed: 9 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,8 @@ Framework '4.5.1x86'
22

33
properties {
44
$base_dir = resolve-path .
5-
$build_dir = "$base_dir\build"
65
$source_dir = "$base_dir\src"
7-
$result_dir = "$build_dir\results"
6+
$result_dir = "$base_dir\results"
87
$artifacts_dir = "$base_dir\artifacts"
98
$global:config = "debug"
109
}
@@ -15,8 +14,8 @@ task local -depends init, compile, test
1514
task ci -depends clean, release, local
1615

1716
task clean {
18-
rd "$source_dir\artifacts" -recurse -force -ErrorAction SilentlyContinue | out-null
19-
rd "$base_dir\build" -recurse -force -ErrorAction SilentlyContinue | out-null
17+
rd "$artifacts_dir" -recurse -force -ErrorAction SilentlyContinue | out-null
18+
rd "$result_dir" -recurse -force -ErrorAction SilentlyContinue | out-null
2019
}
2120

2221
task init {
@@ -38,38 +37,25 @@ task compile -depends clean {
3837

3938
$buildParam = @{ $true = ""; $false = "--version-suffix=$buildSuffix"}[$tag -ne $NULL -and $revision -ne "local"]
4039
$packageParam = @{ $true = ""; $false = "--version-suffix=$suffix"}[$tag -ne $NULL -and $revision -ne "local"]
41-
40+
4241
echo "build: Tag is $tag"
4342
echo "build: Package version suffix is $suffix"
4443
echo "build: Build version suffix is $buildSuffix"
4544

46-
# restore packages to get Fixie.Console.exe in packages folder
47-
exec { .\.nuget\NuGet.exe restore $base_dir\AutoMapper.Collection.sln }
48-
4945
# restore all project references (creating project.assets.json for each project)
50-
exec { dotnet restore $base_dir\AutoMapper.Collection.sln }
46+
exec { dotnet restore $base_dir\AutoMapper.Collection.sln /nologo }
5147

52-
exec { dotnet build $base_dir\AutoMapper.Collection.sln -c $config $buildParam /nologo }
48+
exec { dotnet build $base_dir\AutoMapper.Collection.sln -c $config $buildParam /nologo --no-restore }
5349

54-
exec { dotnet pack $source_dir\AutoMapper.Collection -c $config --include-symbols --no-build --output $artifacts_dir $packageParam /nologo}
55-
56-
exec { dotnet pack $source_dir\AutoMapper.Collection.EntityFramework -c $config --include-symbols --no-build --output $artifacts_dir $packageParam /nologo}
57-
58-
exec { dotnet pack $source_dir\AutoMapper.Collection.LinqToSQL -c $config --include-symbols --no-build --output $artifacts_dir $packageParam /nologo}
50+
exec { dotnet pack $base_dir\AutoMapper.Collection.sln -c $config --include-symbols --no-build --no-restore --output $artifacts_dir $packageParam /nologo}
5951
}
6052

6153
task test {
62-
$testRunners = @(gci $base_dir\packages -rec -filter Fixie.Console.exe)
6354

64-
if ($testRunners.Length -ne 1)
65-
{
66-
throw "Expected to find 1 Fixie.Console.exe, but found $($testRunners.Length)."
67-
}
55+
exec { dotnet test $source_dir\AutoMapper.Collection.Tests -c $config --no-build --no-restore --results-directory $result_dir --logger trx /nologo }
6856

69-
$testRunner = $testRunners[0].FullName
57+
exec { dotnet test $source_dir\AutoMapper.Collection.EntityFramework.Tests -c $config --no-build --no-restore --results-directory $result_dir --logger trx /nologo }
7058

71-
exec { & $testRunner $source_dir\AutoMapper.Collection.Tests\bin\$config\AutoMapper.Collection.Tests.dll }
72-
exec { & $testRunner $source_dir\AutoMapper.Collection.EntityFramework.Tests\bin\$config\AutoMapper.Collection.EntityFramework.Tests.dll }
7359
}
7460

7561
function Install-Dotnet
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
using Xunit;
2+
3+
[assembly: CollectionBehavior(DisableTestParallelization = true)]
Lines changed: 19 additions & 89 deletions
Original file line numberDiff line numberDiff line change
@@ -1,99 +1,29 @@
1-
<?xml version="1.0" encoding="utf-8"?>
2-
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3-
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
1+
<Project Sdk="Microsoft.NET.Sdk">
2+
43
<PropertyGroup>
5-
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
6-
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
7-
<ProjectGuid>{BDE127AB-AC3F-44DF-BC33-210DAFD12E15}</ProjectGuid>
8-
<OutputType>Library</OutputType>
9-
<AppDesignerFolder>Properties</AppDesignerFolder>
10-
<RootNamespace>AutoMapper.Collection.EntityFramework.Tests</RootNamespace>
4+
<TargetFrameworks>net461</TargetFrameworks>
115
<AssemblyName>AutoMapper.Collection.EntityFramework.Tests</AssemblyName>
12-
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
13-
<FileAlignment>512</FileAlignment>
14-
</PropertyGroup>
15-
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
16-
<DebugSymbols>true</DebugSymbols>
17-
<DebugType>full</DebugType>
18-
<Optimize>false</Optimize>
19-
<OutputPath>bin\Debug\</OutputPath>
20-
<DefineConstants>DEBUG;TRACE</DefineConstants>
21-
<ErrorReport>prompt</ErrorReport>
22-
<WarningLevel>4</WarningLevel>
23-
</PropertyGroup>
24-
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
25-
<DebugType>pdbonly</DebugType>
26-
<Optimize>true</Optimize>
27-
<OutputPath>bin\Release\</OutputPath>
28-
<DefineConstants>TRACE</DefineConstants>
29-
<ErrorReport>prompt</ErrorReport>
30-
<WarningLevel>4</WarningLevel>
6+
<IsPackable>false</IsPackable>
317
</PropertyGroup>
8+
329
<ItemGroup>
33-
<Reference Include="AutoMapper, Version=6.2.1.0, Culture=neutral, PublicKeyToken=be96cd2c38ef1005, processorArchitecture=MSIL">
34-
<HintPath>..\..\packages\AutoMapper.6.2.1\lib\net45\AutoMapper.dll</HintPath>
35-
</Reference>
36-
<Reference Include="EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, processorArchitecture=MSIL">
37-
<HintPath>..\..\packages\EntityFramework.6.1.3\lib\net45\EntityFramework.dll</HintPath>
38-
<Private>True</Private>
39-
</Reference>
40-
<Reference Include="EntityFramework.SqlServer, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, processorArchitecture=MSIL">
41-
<HintPath>..\..\packages\EntityFramework.6.1.3\lib\net45\EntityFramework.SqlServer.dll</HintPath>
42-
<Private>True</Private>
43-
</Reference>
44-
<Reference Include="Fixie, Version=1.0.2.0, Culture=neutral, processorArchitecture=MSIL">
45-
<HintPath>..\..\packages\Fixie.1.0.2\lib\net45\Fixie.dll</HintPath>
46-
<Private>True</Private>
47-
</Reference>
48-
<Reference Include="FluentAssertions, Version=4.15.0.0, Culture=neutral, PublicKeyToken=33f2691a05b67b6a, processorArchitecture=MSIL">
49-
<HintPath>..\..\packages\FluentAssertions.4.15.0\lib\net45\FluentAssertions.dll</HintPath>
50-
<Private>True</Private>
51-
</Reference>
52-
<Reference Include="FluentAssertions.Core, Version=4.15.0.0, Culture=neutral, PublicKeyToken=33f2691a05b67b6a, processorArchitecture=MSIL">
53-
<HintPath>..\..\packages\FluentAssertions.4.15.0\lib\net45\FluentAssertions.Core.dll</HintPath>
54-
<Private>True</Private>
55-
</Reference>
56-
<Reference Include="System" />
57-
<Reference Include="System.ComponentModel.DataAnnotations" />
58-
<Reference Include="System.Core" />
59-
<Reference Include="System.ValueTuple, Version=4.0.1.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
60-
<HintPath>..\..\packages\System.ValueTuple.4.3.0\lib\netstandard1.0\System.ValueTuple.dll</HintPath>
61-
<Private>True</Private>
62-
</Reference>
63-
<Reference Include="System.Xml.Linq" />
64-
<Reference Include="System.Data.DataSetExtensions" />
65-
<Reference Include="Microsoft.CSharp" />
66-
<Reference Include="System.Data" />
67-
<Reference Include="System.Net.Http" />
68-
<Reference Include="System.Xml" />
10+
<PackageReference Include="System.ValueTuple" Version="4.3.0" />
6911
</ItemGroup>
12+
7013
<ItemGroup>
71-
<Compile Include="MapCollectionWithEqualityTests.cs" />
72-
<Compile Include="Properties\AssemblyInfo.cs" />
14+
<ProjectReference Include="..\AutoMapper.Collection.EntityFramework\AutoMapper.Collection.EntityFramework.csproj" />
7315
</ItemGroup>
74-
<ItemGroup>
75-
<None Include="App.config" />
76-
<None Include="packages.config" />
77-
</ItemGroup>
78-
<ItemGroup>
79-
<Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
16+
17+
<ItemGroup Condition=" '$(TargetFramework)' == 'net461' ">
18+
<Reference Include="System" />
19+
<Reference Include="Microsoft.CSharp" />
8020
</ItemGroup>
21+
8122
<ItemGroup>
82-
<ProjectReference Include="..\AutoMapper.Collection.EntityFramework\AutoMapper.Collection.EntityFramework.csproj">
83-
<Project>{e0fd41fd-af5b-4bec-970f-8412e7b6c914}</Project>
84-
<Name>AutoMapper.Collection.EntityFramework</Name>
85-
</ProjectReference>
86-
<ProjectReference Include="..\AutoMapper.Collection\AutoMapper.Collection.csproj">
87-
<Project>{37ad667a-8080-476c-88fd-20310ac7caf3}</Project>
88-
<Name>AutoMapper.Collection</Name>
89-
</ProjectReference>
23+
<PackageReference Include="FluentAssertions" Version="$(FluentAssertions)" />
24+
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="$(TestSDKVersion)" />
25+
<PackageReference Include="xunit" Version="$(xUnitVersion)" />
26+
<PackageReference Include="xunit.runner.visualstudio" Version="$(xUnitVersion)" />
9027
</ItemGroup>
91-
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
92-
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
93-
Other similar extension points exist, see Microsoft.Common.targets.
94-
<Target Name="BeforeBuild">
95-
</Target>
96-
<Target Name="AfterBuild">
97-
</Target>
98-
-->
99-
</Project>
28+
29+
</Project>

src/AutoMapper.Collection.EntityFramework.Tests/MapCollectionWithEqualityTests.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
using AutoMapper.EntityFramework;
66
using AutoMapper.EquivalencyExpression;
77
using FluentAssertions;
8+
using Xunit;
89

910
namespace AutoMapper.Collection.EntityFramework.Tests
1011
{
@@ -21,6 +22,7 @@ public MapCollectionWithEqualityTests()
2122
});
2223
}
2324

25+
[Fact]
2426
public void Should_Keep_Existing_List()
2527
{
2628
var dtos = new List<ThingDto>
@@ -38,6 +40,7 @@ public void Should_Keep_Existing_List()
3840
Mapper.Map(dtos, items).Should().BeSameAs(items);
3941
}
4042

43+
[Fact]
4144
public void Should_Update_Existing_Item()
4245
{
4346
var dtos = new List<ThingDto>
@@ -56,6 +59,7 @@ public void Should_Update_Existing_Item()
5659
Mapper.Map(dtos, items.ToList()).Should().HaveElementAt(0, cache.First());
5760
}
5861

62+
[Fact]
5963
public void Should_Work_With_Null_Destination()
6064
{
6165
var dtos = new List<ThingDto>
@@ -67,6 +71,7 @@ public void Should_Work_With_Null_Destination()
6771
Mapper.Map<List<Thing>>(dtos).Should().HaveSameCount(dtos);
6872
}
6973

74+
[Fact]
7075
public void Should_Be_Instanced_Based()
7176
{
7277
Mapper.Reset();
@@ -92,6 +97,7 @@ public void Should_Be_Instanced_Based()
9297
Mapper.Map(dtos, items.ToList()).Should().NotContain(cache.First());
9398
}
9499

100+
//[Fact]
95101
//public void Should_Persist_To_Update()
96102
//{
97103
// var db = new DB();

src/AutoMapper.Collection.EntityFramework.Tests/Properties/AssemblyInfo.cs

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

src/AutoMapper.Collection.EntityFramework.Tests/packages.config

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

src/AutoMapper.Collection.EntityFramework/AutoMapper.Collection.EntityFramework.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
<PropertyGroup>
44
<Description>Collection updating support for EntityFramework with AutoMapper. Extends DBSet&lt;T&gt; with Persist&lt;TDto&gt;().InsertUpdate(dto) and Persist&lt;TDto&gt;().Delete(dto). Will find the matching object and will Insert/Update/Delete.</Description>
5-
<VersionPrefix>3.1.3</VersionPrefix>
65
<Authors>Tyler Carlson</Authors>
76
<TargetFramework>net45</TargetFramework>
87
<AssemblyName>AutoMapper.Collection.EntityFramework</AssemblyName>
@@ -21,6 +20,7 @@
2120
</ItemGroup>
2221

2322
<ItemGroup>
23+
<PackageReference Include="AutoMapper.Extensions.ExpressionMapping" Version="1.0.0" />
2424
<PackageReference Include="EntityFramework" Version="6.1.3" />
2525
</ItemGroup>
2626

0 commit comments

Comments
 (0)