Skip to content

Commit

Permalink
Fixed unittests - cyclic projection tested
Browse files Browse the repository at this point in the history
  • Loading branch information
gentledepp authored and jbogard committed Aug 8, 2016
1 parent bf8d30f commit 364aa4b
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 4 deletions.
3 changes: 3 additions & 0 deletions src/AutoMapperSamples/AutoMapperSamples.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,9 @@
<Name>AutoMapper.Net4</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
</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.
Expand Down
2 changes: 2 additions & 0 deletions src/IntegrationTests.Net4/IntegrationTests.Net4.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@
</Reference>
<Reference Include="Fixie, Version=1.0.0.41, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\Fixie.1.0.0.41\lib\net45\Fixie.dll</HintPath>
<Reference Include="Fixie, Version=1.0.0.33, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\Fixie.1.0.0.33\lib\net45\Fixie.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Rhino.Mocks">
Expand Down
12 changes: 8 additions & 4 deletions src/UnitTests/Query/SourceInjectedQuery.cs
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,7 @@ public void Map_orderBy_thenBy_expression()
public void CanMapCyclicObjectGraph()
{
// Arrange
SetupAutoMapper();
var master = new Master()
{
Name = "Harry Marry",
Expand All @@ -207,6 +208,7 @@ public void CanMapCyclicObjectGraph()
public void CanMapCaclicExpressionGraph()
{
// Arrange
SetupAutoMapper();
var master = new Master()
{
Name = "Harry Marry",
Expand Down Expand Up @@ -235,6 +237,7 @@ public void CanMapCaclicExpressionGraph()
public void CanMapCaclicExpressionGraph_WithPropertyFilter()
{
// Arrange
SetupAutoMapper();
var master = new Master()
{
Name = "Harry Marry",
Expand Down Expand Up @@ -264,6 +267,7 @@ public void CanMapCaclicExpressionGraph_WithPropertyFilter()
public void CanMapCaclicExpressionGraph_WithPropertyPathEqualityFilter_Single()
{
// Arrange
SetupAutoMapper();
var master = new Master()
{
Name = "Harry Marry",
Expand Down Expand Up @@ -295,9 +299,9 @@ public void Should_support_propertypath_expressons_with_equally_named_properties
{
// Arrange
SetupAutoMapper();
var master = new Master {Id = Guid.NewGuid(), Name="Harry Marry"};
var detail = new Detail {Id = Guid.NewGuid(), Master = master, Name = "Some detail"};

var master = new Master { Id = Guid.NewGuid(), Name = "Harry Marry" };
var detail = new Detail { Id = Guid.NewGuid(), Master = master, Name = "Some detail" };
master.Details.Add(detail);
var source = new List<Detail> { detail };

Expand All @@ -320,7 +324,7 @@ private void AssertValidDtoGraph(Detail detail, Master master, DetailCyclicDto d
detail.Master.Id.ShouldEqual(master.Id);

dto.Master.Details.Single().Id.ShouldEqual(dto.Id, "Dto was not added to inner collection");
dto.GetHashCode().ShouldNotEqual(dto.Master.Details.Single().GetHashCode()); // "Underlying provider always creates two distinct instances"
dto.GetHashCode().ShouldEqual(dto.Master.Details.Single().GetHashCode()); // "Underlying provider always creates two distinct instances"
}
[Fact]
public void SupportsParmeterization()
Expand Down
2 changes: 2 additions & 0 deletions src/UnitTests/UnitTests.Net4.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,8 @@
<ItemGroup>
<Reference Include="Fixie, Version=1.0.0.41, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\Fixie.1.0.0.41\lib\net45\Fixie.dll</HintPath>
<Reference Include="Fixie, Version=1.0.0.33, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\Fixie.1.0.0.33\lib\net45\Fixie.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Microsoft.CSharp" />
Expand Down

0 comments on commit 364aa4b

Please sign in to comment.