Skip to content

Commit

Permalink
signing project
Browse files Browse the repository at this point in the history
  • Loading branch information
chaowlert committed Mar 18, 2016
1 parent ea684ac commit ca875b3
Show file tree
Hide file tree
Showing 35 changed files with 236 additions and 225 deletions.
16 changes: 10 additions & 6 deletions src/Mapster.Tests/Mapster.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -34,17 +34,20 @@
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup>
<SignAssembly>true</SignAssembly>
</PropertyGroup>
<PropertyGroup>
<AssemblyOriginatorKeyFile>Mapster.Tests.snk</AssemblyOriginatorKeyFile>
</PropertyGroup>
<ItemGroup>
<Reference Include="Newtonsoft.Json, Version=8.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<HintPath>..\packages\Newtonsoft.Json.8.0.2\lib\net45\Newtonsoft.Json.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="nunit.framework, Version=2.6.4.14350, Culture=neutral, PublicKeyToken=96d09a1eb7f44a77, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\packages\NUnit.2.6.4\lib\nunit.framework.dll</HintPath>
</Reference>
<Reference Include="Should">
<HintPath>..\packages\Should.1.1.20\lib\Should.dll</HintPath>
<Reference Include="Shouldly, Version=2.6.0.0, Culture=neutral, PublicKeyToken=6042cbcb05cbc941, processorArchitecture=MSIL">
<HintPath>..\packages\Shouldly.2.6.0\lib\net40\Shouldly.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="System" />
<Reference Include="System.ComponentModel.DataAnnotations" />
Expand Down Expand Up @@ -103,6 +106,7 @@
<Compile Include="WhenUsingNonDefaultConstructor.cs" />
</ItemGroup>
<ItemGroup>
<None Include="Mapster.Tests.snk" />
<None Include="packages.config" />
</ItemGroup>
<ItemGroup>
Expand Down
Binary file added src/Mapster.Tests/Mapster.Tests.snk
Binary file not shown.
12 changes: 6 additions & 6 deletions src/Mapster.Tests/WhenAddingCustomMappings.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using System;
using System.Collections.Generic;
using NUnit.Framework;
using Should;
using Shouldly;

namespace Mapster.Tests
{
Expand All @@ -19,9 +19,9 @@ public void Property_Is_Mapped_To_Different_Property_Successfully()

var dto = TypeAdapter.Adapt<SimplePoco, SimpleDto>(poco);

dto.Id.ShouldEqual(poco.Id);
dto.Name.ShouldEqual(poco.Name);
dto.AnotherName.ShouldEqual(poco.Name);
dto.Id.ShouldBe(poco.Id);
dto.Name.ShouldBe(poco.Name);
dto.AnotherName.ShouldBe(poco.Name);
}

[Test]
Expand All @@ -35,8 +35,8 @@ public void Property_Is_Mapped_From_Null_Value_Successfully()

var dto = TypeAdapter.Adapt<SimplePoco, SimpleDto>(poco);

dto.Id.ShouldEqual(poco.Id);
dto.Name.ShouldEqual(poco.Name);
dto.Id.ShouldBe(poco.Id);
dto.Name.ShouldBe(poco.Name);
dto.AnotherName.ShouldBeNull();
}

Expand Down
6 changes: 3 additions & 3 deletions src/Mapster.Tests/WhenCloningConfig.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
using System.Linq;
using Mapster.Models;
using NUnit.Framework;
using Should;
using Shouldly;

namespace Mapster.Tests
{
Expand All @@ -27,7 +27,7 @@ public void Alter_Config_After_Map_Should_Error()
Name = "test",
};
var result = TypeAdapter.Adapt<SimpleDto>(poco);
result.Name.ShouldEqual("a");
result.Name.ShouldBe("a");

var ex = Assert.Throws<InvalidOperationException>(() =>
TypeAdapterConfig<SimplePoco, SimpleDto>.ForType()
Expand All @@ -47,7 +47,7 @@ public void Clone()
Name = "test",
};
var result = TypeAdapter.Adapt<SimpleDto>(poco);
result.Name.ShouldEqual("a");
result.Name.ShouldBe("a");

var config = TypeAdapterConfig.GlobalSettings.Clone();
var global = TypeAdapterConfig.GlobalSettings;
Expand Down
20 changes: 10 additions & 10 deletions src/Mapster.Tests/WhenCreatingConfigInstance.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using Mapster.Tests.Classes;
using NUnit.Framework;
using Should;
using Shouldly;

namespace Mapster.Tests
{
Expand All @@ -24,9 +24,9 @@ public void Basic_Poco_Is_Mapped_With_New_Config()

var customerDto = customer.Adapt<CustomerDTO>(config);

customerDto.Id.ShouldEqual(12345);
customerDto.Name.ShouldEqual("TestName");
customerDto.Address_Country.ShouldEqual("TestAddressCountry");
customerDto.Id.ShouldBe(12345);
customerDto.Name.ShouldBe("TestName");
customerDto.Address_Country.ShouldBe("TestAddressCountry");
}

[Test]
Expand All @@ -48,9 +48,9 @@ public void ForType_Enhances_Config()

var customerDto = customer.Adapt<CustomerDTO>(config);

customerDto.Id.ShouldEqual(12345);
customerDto.Name.ShouldEqual("TestName_Enhanced");
customerDto.Address_Country.ShouldEqual("TestAddressCountry");
customerDto.Id.ShouldBe(12345);
customerDto.Name.ShouldBe("TestName_Enhanced");
customerDto.Address_Country.ShouldBe("TestAddressCountry");
}

[Test]
Expand All @@ -72,9 +72,9 @@ public void NewConfig_Overwrites_Config()

var customerDto = customer.Adapt<CustomerDTO>(config);

customerDto.Id.ShouldEqual(12345);
customerDto.Name.ShouldEqual("TestName");
customerDto.Address_Country.ShouldEqual("TestAddressCountry");
customerDto.Id.ShouldBe(12345);
customerDto.Name.ShouldBe("TestName");
customerDto.Address_Country.ShouldBe("TestAddressCountry");
}
}
}
14 changes: 7 additions & 7 deletions src/Mapster.Tests/WhenExplicitMappingRequired.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using System;
using System.Collections.Generic;
using NUnit.Framework;
using Should;
using Shouldly;

namespace Mapster.Tests
{
Expand Down Expand Up @@ -50,7 +50,7 @@ public void Mapped_Classes_Succeed_With_Mapped_Enum()

var simpleDto = TypeAdapter.Adapt<SimpleEnumPoco, SimpleDto>(simpleEnumPoco);

simpleDto.Name.ShouldEqual(simpleEnumPoco.Name.ToString());
simpleDto.Name.ShouldBe(simpleEnumPoco.Name.ToString());
}

[Test]
Expand All @@ -64,7 +64,7 @@ public void Mapped_Classes_With_Mapped_Enum_Compiles()
var simpleEnumPoco = new SimpleEnumPoco {Id = Guid.NewGuid(), Name = NameEnum.Martha};
var simpleDto = TypeAdapter.Adapt<SimpleEnumPoco, SimpleDto>(simpleEnumPoco);

simpleDto.Name.ShouldEqual(simpleEnumPoco.Name.ToString());
simpleDto.Name.ShouldBe(simpleEnumPoco.Name.ToString());
}

[Test]
Expand All @@ -78,7 +78,7 @@ public void Mapped_Classes_Succeed()

var simpleDto = TypeAdapter.Adapt<SimplePoco, SimpleDto>(simplePoco);

simpleDto.Name.ShouldEqual(simplePoco.Name);
simpleDto.Name.ShouldBe(simplePoco.Name);
}

[Test]
Expand All @@ -96,7 +96,7 @@ public void Mapped_List_Of_Classes_Succeed()

var simpleDtos = TypeAdapter.Adapt<SimplePoco[], List<SimpleDto>>(simplePocos);

simpleDtos[0].Name.ShouldEqual(simplePocos[0].Name);
simpleDtos[0].Name.ShouldBe(simplePocos[0].Name);
}

[Test]
Expand All @@ -111,7 +111,7 @@ public void Mapped_Classes_Succeed_With_Child_Mapping()

var collectionDto = TypeAdapter.Adapt<CollectionPoco, CollectionDto>(collectionPoco);

collectionDto.Name.ShouldEqual(collectionPoco.Name);
collectionDto.Name.ShouldBe(collectionPoco.Name);
}

[Test]
Expand All @@ -129,7 +129,7 @@ public void Mapped_Classes_Succeed_When_List_To_IList_Is_Mapped()

var results = TypeAdapter.Adapt<IList<SimpleDto>>(simplePoco);

results.Count.ShouldEqual(2);
results.Count.ShouldBe(2);
}

#region TestClasses
Expand Down
10 changes: 5 additions & 5 deletions src/Mapster.Tests/WhenHandlingUnmappedMembers.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
using System.Collections.Generic;
using System.Reflection;
using NUnit.Framework;
using Should;
using Shouldly;

namespace Mapster.Tests
{
Expand All @@ -25,9 +25,9 @@ public void No_Errors_Thrown_With_Default_Configuration_On_Unmapped_Primitive()

var simpleDto = TypeAdapter.Adapt<SimplePoco, SimpleDto>(source);

simpleDto.Name.ShouldEqual("TestName");
simpleDto.Name.ShouldBe("TestName");
simpleDto.UnmappedMember.ShouldBeNull();
simpleDto.UnmappedMember2.ShouldEqual(0);
simpleDto.UnmappedMember2.ShouldBe(0);
}

[Test]
Expand Down Expand Up @@ -58,9 +58,9 @@ public void No_Errors_Thrown_With_Default_Configuration_On_Unmapped_Child_Collec

var destination = TypeAdapter.Adapt<ParentPoco, ParentDto>(source);

destination.Name.ShouldEqual("TestName");
destination.Name.ShouldBe("TestName");
destination.UnmappedChildren.ShouldBeNull();
destination.Children.Count.ShouldEqual(1);
destination.Children.Count.ShouldBe(1);
}

[Test]
Expand Down
10 changes: 5 additions & 5 deletions src/Mapster.Tests/WhenMappingConditionally.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using System;
using System.Collections.Generic;
using NUnit.Framework;
using Should;
using Shouldly;

namespace Mapster.Tests
{
Expand All @@ -19,7 +19,7 @@ public void False_Condition_Primitive_Does_Not_Map()

SimpleDto dto = TypeAdapter.Adapt<SimplePoco, SimpleDto>(poco);

dto.Id.ShouldEqual(poco.Id);
dto.Id.ShouldBe(poco.Id);
dto.Name.ShouldBeNull();
}

Expand All @@ -34,7 +34,7 @@ public void Failed_Condition_Primitive_Does_Not_Map()

SimpleDto dto = TypeAdapter.Adapt<SimplePoco, SimpleDto>(poco);

dto.Id.ShouldEqual(poco.Id);
dto.Id.ShouldBe(poco.Id);
dto.Name.ShouldBeNull();
}

Expand All @@ -50,8 +50,8 @@ public void Passed_Condition_Primitive_Does_Map()

SimpleDto dto = TypeAdapter.Adapt<SimplePoco, SimpleDto>(poco);

dto.Id.ShouldEqual(poco.Id);
dto.Name.ShouldEqual("TestName");
dto.Id.ShouldBe(poco.Id);
dto.Name.ShouldBe("TestName");
}

#region TestClasses
Expand Down
30 changes: 15 additions & 15 deletions src/Mapster.Tests/WhenMappingEnums.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
using System.Diagnostics;
using System.Diagnostics.CodeAnalysis;
using NUnit.Framework;
using Should;
using Shouldly;

namespace Mapster.Tests
{
Expand Down Expand Up @@ -68,9 +68,9 @@ public void String_Is_Mapped_To_Enum()

dto.ShouldNotBeNull();

dto.Id.ShouldEqual(employee.Id);
dto.Name.ShouldEqual(employee.Name);
dto.Department.ShouldEqual(Departments.IT);
dto.Id.ShouldBe(employee.Id);
dto.Name.ShouldBe(employee.Name);
dto.Department.ShouldBe(Departments.IT);
}

[Test]
Expand All @@ -85,9 +85,9 @@ public void Null_String_Is_Mapped_To_Enum_Default()

dto.ShouldNotBeNull();

dto.Id.ShouldEqual(employee.Id);
dto.Name.ShouldEqual(employee.Name);
dto.Department.ShouldEqual(Departments.Finance);
dto.Id.ShouldBe(employee.Id);
dto.Name.ShouldBe(employee.Name);
dto.Department.ShouldBe(Departments.Finance);
}

[Test]
Expand All @@ -102,9 +102,9 @@ public void Empty_String_Is_Mapped_To_Enum_Default()

dto.ShouldNotBeNull();

dto.Id.ShouldEqual(employee.Id);
dto.Name.ShouldEqual(employee.Name);
dto.Department.ShouldEqual(Departments.Finance);
dto.Id.ShouldBe(employee.Id);
dto.Name.ShouldBe(employee.Name);
dto.Department.ShouldBe(Departments.Finance);

}

Expand All @@ -117,9 +117,9 @@ public void Enum_Is_Mapped_To_String()

poco.ShouldNotBeNull();

poco.Id.ShouldEqual(employeeDto.Id);
poco.Name.ShouldEqual(employeeDto.Name);
poco.Department.ShouldEqual(employeeDto.Department.ToString());
poco.Id.ShouldBe(employeeDto.Id);
poco.Name.ShouldBe(employeeDto.Name);
poco.Department.ShouldBe(employeeDto.Department.ToString());
}

[Test]
Expand All @@ -142,9 +142,9 @@ private static void Assert_Flag_Enum(int value, string result)
{
var e = (Flags) value;
var str = TypeAdapter.Adapt<Flags, string>(e);
str.ShouldEqual(result);
str.ShouldBe(result);
var e2 = TypeAdapter.Adapt<string, Flags>(str);
e2.ShouldEqual(e);
e2.ShouldBe(e);
}

[Test, Explicit]
Expand Down
2 changes: 1 addition & 1 deletion src/Mapster.Tests/WhenMappingErrorThrown.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using System;
using NUnit.Framework;
using Should;
using Shouldly;

namespace Mapster.Tests
{
Expand Down
14 changes: 7 additions & 7 deletions src/Mapster.Tests/WhenMappingNonPublicSetters.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using System;
using System.Collections.Generic;
using NUnit.Framework;
using Should;
using Shouldly;

namespace Mapster.Tests
{
Expand All @@ -15,8 +15,8 @@ public void Non_Public_Destination_Setter_Is_Populated()

SimpleDto dto = TypeAdapter.Adapt<SimplePoco, SimpleDto>(poco);

dto.Id.ShouldEqual(poco.Id);
dto.Name.ShouldEqual(poco.Name);
dto.Id.ShouldBe(poco.Id);
dto.Name.ShouldBe(poco.Name);
}

[Test]
Expand All @@ -31,12 +31,12 @@ public void Non_Public_Destination_Collection_Setter_Is_Populated()

CollectionDto dto = TypeAdapter.Adapt<CollectionPoco, CollectionDto>(poco);

dto.Id.ShouldEqual(poco.Id);
dto.Name.ShouldEqual(poco.Name);
dto.Id.ShouldBe(poco.Id);
dto.Name.ShouldBe(poco.Name);

dto.Children.ShouldNotBeNull();
dto.Children.Count.ShouldEqual(1);
dto.Children[0].Id.ShouldEqual(poco.Children[0].Id);
dto.Children.Count.ShouldBe(1);
dto.Children[0].Id.ShouldBe(poco.Children[0].Id);
}

#region TestClasses
Expand Down
Loading

0 comments on commit ca875b3

Please sign in to comment.