diff --git a/src/Mapster.Tests/Mapster.Tests.csproj b/src/Mapster.Tests/Mapster.Tests.csproj
index c0f81fd5..684f6a40 100644
--- a/src/Mapster.Tests/Mapster.Tests.csproj
+++ b/src/Mapster.Tests/Mapster.Tests.csproj
@@ -34,17 +34,20 @@
prompt
4
+
+ true
+
+
+ Mapster.Tests.snk
+
-
- ..\packages\Newtonsoft.Json.8.0.2\lib\net45\Newtonsoft.Json.dll
- True
-
False
..\packages\NUnit.2.6.4\lib\nunit.framework.dll
-
- ..\packages\Should.1.1.20\lib\Should.dll
+
+ ..\packages\Shouldly.2.6.0\lib\net40\Shouldly.dll
+ True
@@ -103,6 +106,7 @@
+
diff --git a/src/Mapster.Tests/Mapster.Tests.snk b/src/Mapster.Tests/Mapster.Tests.snk
new file mode 100644
index 00000000..07e0856a
Binary files /dev/null and b/src/Mapster.Tests/Mapster.Tests.snk differ
diff --git a/src/Mapster.Tests/WhenAddingCustomMappings.cs b/src/Mapster.Tests/WhenAddingCustomMappings.cs
index 16d153c7..ad00d4b0 100644
--- a/src/Mapster.Tests/WhenAddingCustomMappings.cs
+++ b/src/Mapster.Tests/WhenAddingCustomMappings.cs
@@ -1,7 +1,7 @@
using System;
using System.Collections.Generic;
using NUnit.Framework;
-using Should;
+using Shouldly;
namespace Mapster.Tests
{
@@ -19,9 +19,9 @@ public void Property_Is_Mapped_To_Different_Property_Successfully()
var dto = TypeAdapter.Adapt(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]
@@ -35,8 +35,8 @@ public void Property_Is_Mapped_From_Null_Value_Successfully()
var dto = TypeAdapter.Adapt(poco);
- dto.Id.ShouldEqual(poco.Id);
- dto.Name.ShouldEqual(poco.Name);
+ dto.Id.ShouldBe(poco.Id);
+ dto.Name.ShouldBe(poco.Name);
dto.AnotherName.ShouldBeNull();
}
diff --git a/src/Mapster.Tests/WhenCloningConfig.cs b/src/Mapster.Tests/WhenCloningConfig.cs
index ecbc0dc8..603422f5 100644
--- a/src/Mapster.Tests/WhenCloningConfig.cs
+++ b/src/Mapster.Tests/WhenCloningConfig.cs
@@ -2,7 +2,7 @@
using System.Linq;
using Mapster.Models;
using NUnit.Framework;
-using Should;
+using Shouldly;
namespace Mapster.Tests
{
@@ -27,7 +27,7 @@ public void Alter_Config_After_Map_Should_Error()
Name = "test",
};
var result = TypeAdapter.Adapt(poco);
- result.Name.ShouldEqual("a");
+ result.Name.ShouldBe("a");
var ex = Assert.Throws(() =>
TypeAdapterConfig.ForType()
@@ -47,7 +47,7 @@ public void Clone()
Name = "test",
};
var result = TypeAdapter.Adapt(poco);
- result.Name.ShouldEqual("a");
+ result.Name.ShouldBe("a");
var config = TypeAdapterConfig.GlobalSettings.Clone();
var global = TypeAdapterConfig.GlobalSettings;
diff --git a/src/Mapster.Tests/WhenCreatingConfigInstance.cs b/src/Mapster.Tests/WhenCreatingConfigInstance.cs
index 8bee4152..9225b473 100644
--- a/src/Mapster.Tests/WhenCreatingConfigInstance.cs
+++ b/src/Mapster.Tests/WhenCreatingConfigInstance.cs
@@ -1,6 +1,6 @@
using Mapster.Tests.Classes;
using NUnit.Framework;
-using Should;
+using Shouldly;
namespace Mapster.Tests
{
@@ -24,9 +24,9 @@ public void Basic_Poco_Is_Mapped_With_New_Config()
var customerDto = customer.Adapt(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]
@@ -48,9 +48,9 @@ public void ForType_Enhances_Config()
var customerDto = customer.Adapt(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]
@@ -72,9 +72,9 @@ public void NewConfig_Overwrites_Config()
var customerDto = customer.Adapt(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");
}
}
}
\ No newline at end of file
diff --git a/src/Mapster.Tests/WhenExplicitMappingRequired.cs b/src/Mapster.Tests/WhenExplicitMappingRequired.cs
index 7aa4a464..8096f441 100644
--- a/src/Mapster.Tests/WhenExplicitMappingRequired.cs
+++ b/src/Mapster.Tests/WhenExplicitMappingRequired.cs
@@ -1,7 +1,7 @@
using System;
using System.Collections.Generic;
using NUnit.Framework;
-using Should;
+using Shouldly;
namespace Mapster.Tests
{
@@ -50,7 +50,7 @@ public void Mapped_Classes_Succeed_With_Mapped_Enum()
var simpleDto = TypeAdapter.Adapt(simpleEnumPoco);
- simpleDto.Name.ShouldEqual(simpleEnumPoco.Name.ToString());
+ simpleDto.Name.ShouldBe(simpleEnumPoco.Name.ToString());
}
[Test]
@@ -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.Name.ShouldEqual(simpleEnumPoco.Name.ToString());
+ simpleDto.Name.ShouldBe(simpleEnumPoco.Name.ToString());
}
[Test]
@@ -78,7 +78,7 @@ public void Mapped_Classes_Succeed()
var simpleDto = TypeAdapter.Adapt(simplePoco);
- simpleDto.Name.ShouldEqual(simplePoco.Name);
+ simpleDto.Name.ShouldBe(simplePoco.Name);
}
[Test]
@@ -96,7 +96,7 @@ public void Mapped_List_Of_Classes_Succeed()
var simpleDtos = TypeAdapter.Adapt>(simplePocos);
- simpleDtos[0].Name.ShouldEqual(simplePocos[0].Name);
+ simpleDtos[0].Name.ShouldBe(simplePocos[0].Name);
}
[Test]
@@ -111,7 +111,7 @@ public void Mapped_Classes_Succeed_With_Child_Mapping()
var collectionDto = TypeAdapter.Adapt(collectionPoco);
- collectionDto.Name.ShouldEqual(collectionPoco.Name);
+ collectionDto.Name.ShouldBe(collectionPoco.Name);
}
[Test]
@@ -129,7 +129,7 @@ public void Mapped_Classes_Succeed_When_List_To_IList_Is_Mapped()
var results = TypeAdapter.Adapt>(simplePoco);
- results.Count.ShouldEqual(2);
+ results.Count.ShouldBe(2);
}
#region TestClasses
diff --git a/src/Mapster.Tests/WhenHandlingUnmappedMembers.cs b/src/Mapster.Tests/WhenHandlingUnmappedMembers.cs
index b1b8a17f..6ef34ace 100644
--- a/src/Mapster.Tests/WhenHandlingUnmappedMembers.cs
+++ b/src/Mapster.Tests/WhenHandlingUnmappedMembers.cs
@@ -2,7 +2,7 @@
using System.Collections.Generic;
using System.Reflection;
using NUnit.Framework;
-using Should;
+using Shouldly;
namespace Mapster.Tests
{
@@ -25,9 +25,9 @@ public void No_Errors_Thrown_With_Default_Configuration_On_Unmapped_Primitive()
var simpleDto = TypeAdapter.Adapt(source);
- simpleDto.Name.ShouldEqual("TestName");
+ simpleDto.Name.ShouldBe("TestName");
simpleDto.UnmappedMember.ShouldBeNull();
- simpleDto.UnmappedMember2.ShouldEqual(0);
+ simpleDto.UnmappedMember2.ShouldBe(0);
}
[Test]
@@ -58,9 +58,9 @@ public void No_Errors_Thrown_With_Default_Configuration_On_Unmapped_Child_Collec
var destination = TypeAdapter.Adapt(source);
- destination.Name.ShouldEqual("TestName");
+ destination.Name.ShouldBe("TestName");
destination.UnmappedChildren.ShouldBeNull();
- destination.Children.Count.ShouldEqual(1);
+ destination.Children.Count.ShouldBe(1);
}
[Test]
diff --git a/src/Mapster.Tests/WhenMappingConditionally.cs b/src/Mapster.Tests/WhenMappingConditionally.cs
index 7ff7800c..b500aa4f 100644
--- a/src/Mapster.Tests/WhenMappingConditionally.cs
+++ b/src/Mapster.Tests/WhenMappingConditionally.cs
@@ -1,7 +1,7 @@
using System;
using System.Collections.Generic;
using NUnit.Framework;
-using Should;
+using Shouldly;
namespace Mapster.Tests
{
@@ -19,7 +19,7 @@ public void False_Condition_Primitive_Does_Not_Map()
SimpleDto dto = TypeAdapter.Adapt(poco);
- dto.Id.ShouldEqual(poco.Id);
+ dto.Id.ShouldBe(poco.Id);
dto.Name.ShouldBeNull();
}
@@ -34,7 +34,7 @@ public void Failed_Condition_Primitive_Does_Not_Map()
SimpleDto dto = TypeAdapter.Adapt(poco);
- dto.Id.ShouldEqual(poco.Id);
+ dto.Id.ShouldBe(poco.Id);
dto.Name.ShouldBeNull();
}
@@ -50,8 +50,8 @@ public void Passed_Condition_Primitive_Does_Map()
SimpleDto dto = TypeAdapter.Adapt(poco);
- dto.Id.ShouldEqual(poco.Id);
- dto.Name.ShouldEqual("TestName");
+ dto.Id.ShouldBe(poco.Id);
+ dto.Name.ShouldBe("TestName");
}
#region TestClasses
diff --git a/src/Mapster.Tests/WhenMappingEnums.cs b/src/Mapster.Tests/WhenMappingEnums.cs
index 3f113428..bbbe8400 100644
--- a/src/Mapster.Tests/WhenMappingEnums.cs
+++ b/src/Mapster.Tests/WhenMappingEnums.cs
@@ -2,7 +2,7 @@
using System.Diagnostics;
using System.Diagnostics.CodeAnalysis;
using NUnit.Framework;
-using Should;
+using Shouldly;
namespace Mapster.Tests
{
@@ -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]
@@ -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]
@@ -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);
}
@@ -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]
@@ -142,9 +142,9 @@ private static void Assert_Flag_Enum(int value, string result)
{
var e = (Flags) value;
var str = TypeAdapter.Adapt(e);
- str.ShouldEqual(result);
+ str.ShouldBe(result);
var e2 = TypeAdapter.Adapt(str);
- e2.ShouldEqual(e);
+ e2.ShouldBe(e);
}
[Test, Explicit]
diff --git a/src/Mapster.Tests/WhenMappingErrorThrown.cs b/src/Mapster.Tests/WhenMappingErrorThrown.cs
index ef0ecc6d..8a1ff14b 100644
--- a/src/Mapster.Tests/WhenMappingErrorThrown.cs
+++ b/src/Mapster.Tests/WhenMappingErrorThrown.cs
@@ -1,6 +1,6 @@
using System;
using NUnit.Framework;
-using Should;
+using Shouldly;
namespace Mapster.Tests
{
diff --git a/src/Mapster.Tests/WhenMappingNonPublicSetters.cs b/src/Mapster.Tests/WhenMappingNonPublicSetters.cs
index 9fff772b..9253aeeb 100644
--- a/src/Mapster.Tests/WhenMappingNonPublicSetters.cs
+++ b/src/Mapster.Tests/WhenMappingNonPublicSetters.cs
@@ -1,7 +1,7 @@
using System;
using System.Collections.Generic;
using NUnit.Framework;
-using Should;
+using Shouldly;
namespace Mapster.Tests
{
@@ -15,8 +15,8 @@ public void Non_Public_Destination_Setter_Is_Populated()
SimpleDto dto = TypeAdapter.Adapt(poco);
- dto.Id.ShouldEqual(poco.Id);
- dto.Name.ShouldEqual(poco.Name);
+ dto.Id.ShouldBe(poco.Id);
+ dto.Name.ShouldBe(poco.Name);
}
[Test]
@@ -31,12 +31,12 @@ public void Non_Public_Destination_Collection_Setter_Is_Populated()
CollectionDto dto = TypeAdapter.Adapt(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
diff --git a/src/Mapster.Tests/WhenMappingNullablePrimitives.cs b/src/Mapster.Tests/WhenMappingNullablePrimitives.cs
index 67e4490b..7403f797 100644
--- a/src/Mapster.Tests/WhenMappingNullablePrimitives.cs
+++ b/src/Mapster.Tests/WhenMappingNullablePrimitives.cs
@@ -1,6 +1,6 @@
using System;
using NUnit.Framework;
-using Should;
+using Shouldly;
namespace Mapster.Tests
{
@@ -20,8 +20,8 @@ public void Can_Map_From_Null_Source_To_Non_Nullable_Existing_Target()
dto = TypeAdapter.Adapt(poco);
- dto.Id.ShouldEqual(poco.Id);
- dto.Name.ShouldEqual(poco.Name);
+ dto.Id.ShouldBe(poco.Id);
+ dto.Name.ShouldBe(poco.Name);
dto.IsImport.ShouldBeFalse();
}
@@ -34,8 +34,8 @@ public void Can_Map_From_Null_Source_To_Non_Nullable_Target()
NonNullablePrimitivesDto dto = TypeAdapter.Adapt(poco);
- dto.Id.ShouldEqual(poco.Id);
- dto.Name.ShouldEqual(poco.Name);
+ dto.Id.ShouldBe(poco.Id);
+ dto.Name.ShouldBe(poco.Name);
dto.IsImport.ShouldBeFalse();
}
@@ -46,8 +46,8 @@ public void Can_Map_From_Nullable_Source_To_Nullable_Target()
NullablePrimitivesPoco2 dto = TypeAdapter.Adapt(poco);
- dto.Id.ShouldEqual(poco.Id);
- dto.Name.ShouldEqual(poco.Name);
+ dto.Id.ShouldBe(poco.Id);
+ dto.Name.ShouldBe(poco.Name);
dto.IsImport.ShouldBeNull();
dto.Amount.ShouldBeNull();
}
@@ -65,8 +65,8 @@ public void Can_Map_From_Nullable_Source_To_Nullable_Existing_Target()
TypeAdapter.Adapt(poco, dto);
- dto.Id.ShouldEqual(poco.Id);
- dto.Name.ShouldEqual(poco.Name);
+ dto.Id.ShouldBe(poco.Id);
+ dto.Name.ShouldBe(poco.Name);
dto.IsImport.ShouldBeNull();
dto.Amount.ShouldBeNull();
}
@@ -80,10 +80,10 @@ public void Can_Map_From_Nullable_Source_With_Values_To_Non_Nullable_Target()
NonNullablePrimitivesDto dto = TypeAdapter.Adapt(poco);
- dto.Id.ShouldEqual(poco.Id);
- dto.Name.ShouldEqual(poco.Name);
+ dto.Id.ShouldBe(poco.Id);
+ dto.Name.ShouldBe(poco.Name);
dto.IsImport.ShouldBeTrue();
- dto.Amount.ShouldEqual(10);
+ dto.Amount.ShouldBe(10);
}
[Test]
@@ -95,10 +95,10 @@ public void Can_Map_From_Nullable_Source_Without_Values_To_Non_Nullable_Target()
NonNullablePrimitivesDto dto = TypeAdapter.Adapt(poco);
- dto.Id.ShouldEqual(poco.Id);
- dto.Name.ShouldEqual(poco.Name);
+ dto.Id.ShouldBe(poco.Id);
+ dto.Name.ShouldBe(poco.Name);
dto.IsImport.ShouldBeFalse();
- dto.Amount.ShouldEqual(0);
+ dto.Amount.ShouldBe(0);
}
[Test]
@@ -114,11 +114,11 @@ public void Can_Map_From_Nullable_Source_With_Values_To_Explicitly_Mapped_Non_Nu
NonNullablePrimitivesDto dto = TypeAdapter.Adapt(poco);
- dto.Id.ShouldEqual(poco.Id);
- dto.Name.ShouldEqual(poco.Name);
+ dto.Id.ShouldBe(poco.Id);
+ dto.Name.ShouldBe(poco.Name);
dto.IsImport.ShouldBeTrue();
- dto.Amount.ShouldEqual(10);
- dto.MyFee.ShouldEqual(20);
+ dto.Amount.ShouldBe(10);
+ dto.MyFee.ShouldBe(20);
}
[Test]
@@ -128,8 +128,8 @@ public void Can_Map_From_Non_Nullable_Source_To_Nullable_Target()
NullablePrimitivesPoco poco = TypeAdapter.Adapt(dto);
- poco.Id.ShouldEqual(dto.Id);
- poco.Name.ShouldEqual(dto.Name);
+ poco.Id.ShouldBe(dto.Id);
+ poco.Name.ShouldBe(dto.Name);
poco.IsImport.GetValueOrDefault().ShouldBeTrue();
}
diff --git a/src/Mapster.Tests/WhenMappingPrimitives.cs b/src/Mapster.Tests/WhenMappingPrimitives.cs
index c59bfc16..fd2b7f44 100644
--- a/src/Mapster.Tests/WhenMappingPrimitives.cs
+++ b/src/Mapster.Tests/WhenMappingPrimitives.cs
@@ -1,7 +1,7 @@
using System;
using System.Text;
using NUnit.Framework;
-using Should;
+using Shouldly;
namespace Mapster.Tests
{
@@ -27,7 +27,7 @@ public void Byte_Array_Is_Mapped_Correctly()
var resultString = Encoding.ASCII.GetString(resultArray);
- testString.ShouldEqual(resultString);
+ testString.ShouldBe(resultString);
}
[Test]
@@ -41,7 +41,7 @@ public void Byte_Array_In_Test_Class_Is_Mapped_Correctly()
var resultString = Encoding.ASCII.GetString(testB.Bytes);
- testString.ShouldEqual(resultString);
+ testString.ShouldBe(resultString);
}
[Test]
@@ -55,8 +55,8 @@ public void ValueType_String_Object_Is_Always_Primitive()
};
var targetDto = TypeAdapter.Adapt(sourceDto);
- targetDto.Id.ShouldEqual(sourceDto.Id);
- targetDto.Time.ShouldEqual(sourceDto.Time);
+ targetDto.Id.ShouldBe(sourceDto.Id);
+ targetDto.Time.ShouldBe(sourceDto.Time);
targetDto.Obj.ShouldBeSameAs(sourceDto.Obj);
}
diff --git a/src/Mapster.Tests/WhenMappingRecordTypes.cs b/src/Mapster.Tests/WhenMappingRecordTypes.cs
index e38d004d..53ada157 100644
--- a/src/Mapster.Tests/WhenMappingRecordTypes.cs
+++ b/src/Mapster.Tests/WhenMappingRecordTypes.cs
@@ -4,7 +4,7 @@
using System.Text;
using System.Threading.Tasks;
using NUnit.Framework;
-using Should;
+using Shouldly;
namespace Mapster.Tests
{
@@ -20,9 +20,9 @@ public void Map_Dictionary()
};
var dest = source.Adapt>();
- dest.Count.ShouldEqual(source.Count);
- dest["a"].Id.ShouldEqual(source["a"].Id);
- dest["a"].Name.ShouldEqual(source["a"].Name);
+ dest.Count.ShouldBe(source.Count);
+ dest["a"].Id.ShouldBe(source["a"].Id);
+ dest["a"].Name.ShouldBe(source["a"].Name);
}
[Test]
@@ -31,10 +31,10 @@ public void Map_RecordType()
var source = new SimplePoco {Id = Guid.NewGuid(), Name = "bar"};
var dest = source.Adapt();
- dest.Id.ShouldEqual(source.Id);
- dest.Name.ShouldEqual(source.Name);
- dest.Day.ShouldEqual(default(DayOfWeek));
- dest.Age.ShouldEqual(10);
+ dest.Id.ShouldBe(source.Id);
+ dest.Name.ShouldBe(source.Name);
+ dest.Day.ShouldBe(default(DayOfWeek));
+ dest.Age.ShouldBe(10);
}
public class SimplePoco
diff --git a/src/Mapster.Tests/WhenMappingWithDictionary.cs b/src/Mapster.Tests/WhenMappingWithDictionary.cs
index cc3f1c1f..88a2430a 100644
--- a/src/Mapster.Tests/WhenMappingWithDictionary.cs
+++ b/src/Mapster.Tests/WhenMappingWithDictionary.cs
@@ -1,7 +1,7 @@
using System;
using System.Collections.Generic;
using NUnit.Framework;
-using Should;
+using Shouldly;
namespace Mapster.Tests
{
@@ -24,9 +24,9 @@ public void Object_To_Dictionary()
var dict = TypeAdapter.Adapt>(poco);
- dict.Count.ShouldEqual(2);
- dict["Id"].ShouldEqual(poco.Id);
- dict["Name"].ShouldEqual(poco.Name);
+ dict.Count.ShouldBe(2);
+ dict["Id"].ShouldBe(poco.Id);
+ dict["Name"].ShouldBe(poco.Name);
}
[Test]
@@ -43,8 +43,8 @@ public void Object_To_Dictionary_Ignore_Null_Values()
var dict = TypeAdapter.Adapt>(poco);
- dict.Count.ShouldEqual(1);
- dict["Id"].ShouldEqual(poco.Id);
+ dict.Count.ShouldBe(1);
+ dict["Id"].ShouldBe(poco.Id);
}
[Test]
@@ -57,7 +57,7 @@ public void Dictionary_To_Object()
};
var poco = TypeAdapter.Adapt(dict);
- poco.Id.ShouldEqual(dict["Id"]);
+ poco.Id.ShouldBe(dict["Id"]);
poco.Name.ShouldBeNull();
}
diff --git a/src/Mapster.Tests/WhenMappingWithExplicitInheritance.cs b/src/Mapster.Tests/WhenMappingWithExplicitInheritance.cs
index 29e8c282..44bec7e8 100644
--- a/src/Mapster.Tests/WhenMappingWithExplicitInheritance.cs
+++ b/src/Mapster.Tests/WhenMappingWithExplicitInheritance.cs
@@ -1,6 +1,6 @@
using System;
using NUnit.Framework;
-using Should;
+using Shouldly;
namespace Mapster.Tests
{
@@ -35,8 +35,8 @@ public void Base_Configuration_Map_Condition_Applies_To_Derived_Class()
var dto = TypeAdapter.Adapt(source);
- dto.Id.ShouldEqual(source.Id);
- dto.Name.ShouldEqual(source.Name + "_Suffix");
+ dto.Id.ShouldBe(source.Id);
+ dto.Name.ShouldBe(source.Name + "_Suffix");
var source2 = new DerivedPoco
{
@@ -46,7 +46,7 @@ public void Base_Configuration_Map_Condition_Applies_To_Derived_Class()
var dto2 = TypeAdapter.Adapt(source2);
- dto2.Id.ShouldEqual(source.Id);
+ dto2.Id.ShouldBe(source.Id);
dto2.Name.ShouldBeNull();
}
@@ -69,8 +69,8 @@ public void Base_Configuration_DestinationTransforms_Apply_To_Derived_Class()
var dto = TypeAdapter.Adapt(source);
- dto.Id.ShouldEqual(source.Id);
- dto.Name.ShouldEqual(source.Name.Trim());
+ dto.Id.ShouldBe(source.Id);
+ dto.Name.ShouldBe(source.Name.Trim());
}
[Test]
@@ -92,7 +92,7 @@ public void Ignores_Are_Derived_From_Base_Configurations()
var dto = TypeAdapter.Adapt(source);
- dto.Id.ShouldEqual(source.Id);
+ dto.Id.ShouldBe(source.Id);
dto.Name.ShouldBeNull();
}
@@ -108,9 +108,9 @@ public void Derived_Config_Shares_Base_Config_Properties()
var derivedConfig = TypeAdapterConfig.NewConfig()
.Inherits().Settings;
- derivedConfig.IgnoreNullValues.ShouldEqual(true);
- derivedConfig.ShallowCopyForSameType.ShouldEqual(true);
- //derivedConfig.MaxDepth.ShouldEqual(5);
+ derivedConfig.IgnoreNullValues.ShouldBe(true);
+ derivedConfig.ShallowCopyForSameType.ShouldBe(true);
+ //derivedConfig.MaxDepth.ShouldBe(5);
}
diff --git a/src/Mapster.Tests/WhenMappingWithExtensionMethods.cs b/src/Mapster.Tests/WhenMappingWithExtensionMethods.cs
index ae1c46cc..a032f3ea 100644
--- a/src/Mapster.Tests/WhenMappingWithExtensionMethods.cs
+++ b/src/Mapster.Tests/WhenMappingWithExtensionMethods.cs
@@ -1,7 +1,7 @@
using System;
using Mapster.Tests.Classes;
using NUnit.Framework;
-using Should;
+using Shouldly;
namespace Mapster.Tests
{
@@ -23,7 +23,7 @@ public void Adapt_With_Source_And_Destination_Type_Succeeds()
var dto = product.Adapt();
dto.ShouldNotBeNull();
- dto.Id.ShouldEqual(product.Id);
+ dto.Id.ShouldBe(product.Id);
}
[Test]
@@ -38,7 +38,7 @@ public void Adapt_With_Source_And_Destination_Types_And_Config_Succeeds()
var dto = product.Adapt(config);
dto.ShouldNotBeNull();
- dto.Id.ShouldEqual(product.Id);
+ dto.Id.ShouldBe(product.Id);
}
[Test]
@@ -52,7 +52,7 @@ public void Adapt_With_Destination_Type_Succeeds()
var dto = product.Adapt();
dto.ShouldNotBeNull();
- dto.Id.ShouldEqual(product.Id);
+ dto.Id.ShouldBe(product.Id);
}
[Test]
@@ -67,7 +67,7 @@ public void Adapt_With_Destination_Type_And_Config_Succeeds()
var dto = product.Adapt(config);
dto.ShouldNotBeNull();
- dto.Id.ShouldEqual(product.Id);
+ dto.Id.ShouldBe(product.Id);
}
}
}
diff --git a/src/Mapster.Tests/WhenMappingWithFlexibleName.cs b/src/Mapster.Tests/WhenMappingWithFlexibleName.cs
index f62ac397..8e95edca 100644
--- a/src/Mapster.Tests/WhenMappingWithFlexibleName.cs
+++ b/src/Mapster.Tests/WhenMappingWithFlexibleName.cs
@@ -1,5 +1,5 @@
using NUnit.Framework;
-using Should;
+using Shouldly;
namespace Mapster.Tests
{
@@ -27,7 +27,7 @@ public void Not_Set_Match_Only_Exact_Name()
var simple = TypeAdapter.Adapt(mix);
- simple.PascalCase.ShouldEqual(mix.PascalCase);
+ simple.PascalCase.ShouldBe(mix.PascalCase);
simple.CamelCase.ShouldBeNull();
simple.UnderScore.ShouldBeNull();
simple.LowerCase.ShouldBeNull();
@@ -52,25 +52,25 @@ public void Map_Flexible_Name()
var simple = TypeAdapter.Adapt(mix);
- simple.PascalCase.ShouldEqual(mix.PascalCase);
- simple.CamelCase.ShouldEqual(mix.camelCase);
- simple.UnderScore.ShouldEqual(mix.__under__SCORE__);
- simple.LowerCase.ShouldEqual(mix.lower_case);
- simple.UpperCase.ShouldEqual(mix.UPPER_CASE);
- simple.MixUnder_SCORE.ShouldEqual(mix.MIX_UnderScore);
+ simple.PascalCase.ShouldBe(mix.PascalCase);
+ simple.CamelCase.ShouldBe(mix.camelCase);
+ simple.UnderScore.ShouldBe(mix.__under__SCORE__);
+ simple.LowerCase.ShouldBe(mix.lower_case);
+ simple.UpperCase.ShouldBe(mix.UPPER_CASE);
+ simple.MixUnder_SCORE.ShouldBe(mix.MIX_UnderScore);
}
[Test]
public void Test_Name()
{
- NameMatchingStrategy.ToPascalCase("PascalCase").ShouldEqual("PascalCase");
- NameMatchingStrategy.ToPascalCase("camelCase").ShouldEqual("CamelCase");
- NameMatchingStrategy.ToPascalCase("lower_case").ShouldEqual("LowerCase");
- NameMatchingStrategy.ToPascalCase("UPPER_CASE").ShouldEqual("UpperCase");
- NameMatchingStrategy.ToPascalCase("IPAddress").ShouldEqual("IpAddress");
- NameMatchingStrategy.ToPascalCase("ItemID").ShouldEqual("ItemId");
- NameMatchingStrategy.ToPascalCase("__under__SCORE__").ShouldEqual("UnderScore");
- NameMatchingStrategy.ToPascalCase("__MixMIXMix_mix").ShouldEqual("MixMixMixMix");
+ NameMatchingStrategy.ToPascalCase("PascalCase").ShouldBe("PascalCase");
+ NameMatchingStrategy.ToPascalCase("camelCase").ShouldBe("CamelCase");
+ NameMatchingStrategy.ToPascalCase("lower_case").ShouldBe("LowerCase");
+ NameMatchingStrategy.ToPascalCase("UPPER_CASE").ShouldBe("UpperCase");
+ NameMatchingStrategy.ToPascalCase("IPAddress").ShouldBe("IpAddress");
+ NameMatchingStrategy.ToPascalCase("ItemID").ShouldBe("ItemId");
+ NameMatchingStrategy.ToPascalCase("__under__SCORE__").ShouldBe("UnderScore");
+ NameMatchingStrategy.ToPascalCase("__MixMIXMix_mix").ShouldBe("MixMixMixMix");
}
public class MixName
diff --git a/src/Mapster.Tests/WhenMappingWithImplicitInheritance.cs b/src/Mapster.Tests/WhenMappingWithImplicitInheritance.cs
index 19b60c23..89ee08b2 100644
--- a/src/Mapster.Tests/WhenMappingWithImplicitInheritance.cs
+++ b/src/Mapster.Tests/WhenMappingWithImplicitInheritance.cs
@@ -1,6 +1,6 @@
using System;
using NUnit.Framework;
-using Should;
+using Shouldly;
namespace Mapster.Tests
{
@@ -32,8 +32,8 @@ public void Base_Configuration_Applies_To_Derived_Class_If_No_Explicit_Configura
var dto = TypeAdapter.Adapt(source);
- dto.Id.ShouldEqual(source.Id);
- dto.Name.ShouldEqual(source.Name + "_Suffix");
+ dto.Id.ShouldBe(source.Id);
+ dto.Name.ShouldBe(source.Name + "_Suffix");
}
[Test]
@@ -52,8 +52,8 @@ public void Base_Configuration_Map_Condition_Applies_To_Derived_Class()
var dto = TypeAdapter.Adapt(source);
- dto.Id.ShouldEqual(source.Id);
- dto.Name.ShouldEqual(source.Name + "_Suffix");
+ dto.Id.ShouldBe(source.Id);
+ dto.Name.ShouldBe(source.Name + "_Suffix");
var source2 = new DerivedPoco
{
@@ -63,7 +63,7 @@ public void Base_Configuration_Map_Condition_Applies_To_Derived_Class()
dto = TypeAdapter.Adapt(source2);
- dto.Id.ShouldEqual(source.Id);
+ dto.Id.ShouldBe(source.Id);
dto.Name.ShouldBeNull();
}
@@ -83,8 +83,8 @@ public void Base_Configuration_DestinationTransforms_Apply_To_Derived_Class()
var dto = TypeAdapter.Adapt(source);
- dto.Id.ShouldEqual(source.Id);
- dto.Name.ShouldEqual(source.Name.Trim());
+ dto.Id.ShouldBe(source.Id);
+ dto.Name.ShouldBe(source.Name.Trim());
}
[Test]
@@ -103,7 +103,7 @@ public void Ignores_Are_Derived_From_Base_Configurations()
var dto = TypeAdapter.Adapt(source);
- dto.Id.ShouldEqual(source.Id);
+ dto.Id.ShouldBe(source.Id);
dto.Name.ShouldBeNull();
}
@@ -125,8 +125,8 @@ public void Base_Configuration_Doesnt_Apply_To_Derived_Class_If_Explicit_Configu
var dto = TypeAdapter.Adapt(source);
- dto.Id.ShouldEqual(source.Id);
- dto.Name.ShouldEqual(source.Name);
+ dto.Id.ShouldBe(source.Id);
+ dto.Name.ShouldBe(source.Name);
}
[Test]
@@ -144,8 +144,8 @@ public void Base_Configuration_Applies_To_Double_Derived_Class_If_No_Explicit_Co
var dto = TypeAdapter.Adapt(source);
- dto.Id.ShouldEqual(source.Id);
- dto.Name.ShouldEqual(source.Name + "_Suffix");
+ dto.Id.ShouldBe(source.Id);
+ dto.Name.ShouldBe(source.Name + "_Suffix");
}
[Test]
@@ -168,8 +168,8 @@ public void Derived_Class_Stops_At_First_Valid_Base_Configuration()
var dto = TypeAdapter.Adapt(source);
- dto.Id.ShouldEqual(source.Id);
- dto.Name.ShouldEqual(source.Name + "_Derived");
+ dto.Id.ShouldBe(source.Id);
+ dto.Name.ShouldBe(source.Name + "_Derived");
}
[Test]
@@ -183,9 +183,9 @@ public void Derived_Config_Shares_Base_Config_Properties()
var derivedConfig = TypeAdapterConfig.GlobalSettings.GetMergedSettings(typeof(DerivedPoco), typeof(SimpleDto), MapType.Map);
- derivedConfig.IgnoreNullValues.ShouldEqual(true);
- derivedConfig.ShallowCopyForSameType.ShouldEqual(true);
- //derivedConfig.MaxDepth.ShouldEqual(5);
+ derivedConfig.IgnoreNullValues.ShouldBe(true);
+ derivedConfig.ShallowCopyForSameType.ShouldBe(true);
+ //derivedConfig.MaxDepth.ShouldBe(5);
}
[Test]
@@ -200,9 +200,9 @@ public void Derived_Config_Shares_Base_Dest_Config_Properties()
var derivedConfig = TypeAdapterConfig.GlobalSettings.GetMergedSettings(typeof(DerivedPoco), typeof(DerivedDto), MapType.Map);
- derivedConfig.IgnoreNullValues.ShouldEqual(true);
- derivedConfig.ShallowCopyForSameType.ShouldEqual(true);
- //derivedConfig.MaxDepth.ShouldEqual(5);
+ derivedConfig.IgnoreNullValues.ShouldBe(true);
+ derivedConfig.ShallowCopyForSameType.ShouldBe(true);
+ //derivedConfig.MaxDepth.ShouldBe(5);
}
[Test]
@@ -237,8 +237,8 @@ public void Ignores_Are_Derived_From_Base_Dest_Configurations()
var dto = TypeAdapter.Adapt(source);
- dto.Id.ShouldEqual(source.Id);
- dto.Name.ShouldEqual(source.Name + "_Suffix");
+ dto.Id.ShouldBe(source.Id);
+ dto.Name.ShouldBe(source.Name + "_Suffix");
}
#region Test Classes
diff --git a/src/Mapster.Tests/WhenMappingWithInstance.cs b/src/Mapster.Tests/WhenMappingWithInstance.cs
index d0a3311c..b26a9a60 100644
--- a/src/Mapster.Tests/WhenMappingWithInstance.cs
+++ b/src/Mapster.Tests/WhenMappingWithInstance.cs
@@ -1,7 +1,7 @@
using System;
using System.Collections.Generic;
using NUnit.Framework;
-using Should;
+using Shouldly;
namespace Mapster.Tests
{
@@ -20,7 +20,7 @@ public void Mapping_Basic_Poco_Succeeds()
var destination = instance.Adapt(source);
- destination.Name.ShouldEqual(source.Name);
+ destination.Name.ShouldBe(source.Name);
}
[Test]
@@ -35,7 +35,7 @@ public void False_Condition_Primitive_Does_Not_Map()
IAdapter instance = TypeAdapter.GetInstance();
SimpleDto dto = instance.Adapt(poco);
- dto.Id.ShouldEqual(poco.Id);
+ dto.Id.ShouldBe(poco.Id);
dto.Name.ShouldBeNull();
}
@@ -52,8 +52,8 @@ public void Passed_Condition_Primitive_Does_Map()
IAdapter instance = TypeAdapter.GetInstance();
SimpleDto dto = instance.Adapt(poco);
- dto.Id.ShouldEqual(poco.Id);
- dto.Name.ShouldEqual("TestName");
+ dto.Id.ShouldBe(poco.Id);
+ dto.Name.ShouldBe("TestName");
}
#region TestClasses
diff --git a/src/Mapster.Tests/WhenPassingRuntimeValue.cs b/src/Mapster.Tests/WhenPassingRuntimeValue.cs
index 2ddd29f2..aaabce68 100644
--- a/src/Mapster.Tests/WhenPassingRuntimeValue.cs
+++ b/src/Mapster.Tests/WhenPassingRuntimeValue.cs
@@ -1,6 +1,6 @@
using System;
using NUnit.Framework;
-using Should;
+using Shouldly;
namespace Mapster.Tests
{
@@ -22,7 +22,7 @@ public void Passing_Runtime_Value()
.AddParameters("user", this.User)
.AdaptToType();
- dto.CreatedBy.ShouldEqual(this.User);
+ dto.CreatedBy.ShouldBe(this.User);
}
private string User { get; } = Guid.NewGuid().ToString("N");
diff --git a/src/Mapster.Tests/WhenPerformingAfterMapping.cs b/src/Mapster.Tests/WhenPerformingAfterMapping.cs
index a931f3ca..14bf6eba 100644
--- a/src/Mapster.Tests/WhenPerformingAfterMapping.cs
+++ b/src/Mapster.Tests/WhenPerformingAfterMapping.cs
@@ -1,6 +1,6 @@
using System;
using NUnit.Framework;
-using Should;
+using Shouldly;
namespace Mapster.Tests
{
@@ -26,8 +26,8 @@ public void After_Mapping()
};
var result = TypeAdapter.Adapt(poco);
- result.Id.ShouldEqual(poco.Id);
- result.Name.ShouldEqual(poco.Name + "xxx");
+ result.Id.ShouldBe(poco.Id);
+ result.Name.ShouldBe(poco.Name + "xxx");
}
[Test]
diff --git a/src/Mapster.Tests/WhenPerformingDestinationTransforms.cs b/src/Mapster.Tests/WhenPerformingDestinationTransforms.cs
index c2e430d7..b4bbd859 100644
--- a/src/Mapster.Tests/WhenPerformingDestinationTransforms.cs
+++ b/src/Mapster.Tests/WhenPerformingDestinationTransforms.cs
@@ -1,7 +1,7 @@
using System;
using System.Collections.Generic;
using NUnit.Framework;
-using Should;
+using Shouldly;
namespace Mapster.Tests
{
@@ -24,7 +24,7 @@ public void Transform_Doesnt_Occur_If_None_Present()
var destination = TypeAdapter.Adapt(source);
- destination.Name.ShouldEqual(source.Name);
+ destination.Name.ShouldBe(source.Name);
}
[Test]
@@ -36,7 +36,7 @@ public void Global_Destination_Transform_Is_Applied_To_Class()
var source = new SimplePoco {Id = new Guid(), Name = "Test "};
var destination = TypeAdapter.Adapt(source);
- destination.Name.ShouldEqual("Test");
+ destination.Name.ShouldBe("Test");
}
[Test]
@@ -49,7 +49,7 @@ public void Adapter_Destination_Transform_Is_Applied_To_Class()
var source = new SimplePoco { Id = new Guid(), Name = "Test " };
var destination = TypeAdapter.Adapt(source);
- destination.Name.ShouldEqual("Test");
+ destination.Name.ShouldBe("Test");
}
diff --git a/src/Mapster.Tests/WhenPreserveReferences.cs b/src/Mapster.Tests/WhenPreserveReferences.cs
index b40beb2f..ea355275 100644
--- a/src/Mapster.Tests/WhenPreserveReferences.cs
+++ b/src/Mapster.Tests/WhenPreserveReferences.cs
@@ -1,7 +1,6 @@
using System;
-using Newtonsoft.Json.Linq;
using NUnit.Framework;
-using Should;
+using Shouldly;
namespace Mapster.Tests
{
diff --git a/src/Mapster.Tests/WhenProjecting.cs b/src/Mapster.Tests/WhenProjecting.cs
index ffe642e0..664e8bac 100644
--- a/src/Mapster.Tests/WhenProjecting.cs
+++ b/src/Mapster.Tests/WhenProjecting.cs
@@ -3,7 +3,7 @@
using System.Linq;
using Mapster.Tests.Classes;
using NUnit.Framework;
-using Should;
+using Shouldly;
namespace Mapster.Tests
{
@@ -82,7 +82,7 @@ public void TestPocoTypeMapping()
Discount = Param_1.Discount,
}).ToList()
};
- resultQuery.ToString().ShouldEqual(expectedQuery.ToString());
+ resultQuery.ToString().ShouldBe(expectedQuery.ToString());
}
}
}
diff --git a/src/Mapster.Tests/WhenRegisteringAndMappingRace.cs b/src/Mapster.Tests/WhenRegisteringAndMappingRace.cs
index 232c2d3e..1e543a18 100644
--- a/src/Mapster.Tests/WhenRegisteringAndMappingRace.cs
+++ b/src/Mapster.Tests/WhenRegisteringAndMappingRace.cs
@@ -2,7 +2,7 @@
using System.Collections.Generic;
using System.Threading.Tasks;
using NUnit.Framework;
-using Should;
+using Shouldly;
namespace Mapster.Tests
{
@@ -56,7 +56,7 @@ public void Race_Condition_Produces_Error()
}
});
- exception.InnerException.ShouldBeType(typeof(ArgumentOutOfRangeException));
+ exception.InnerException.ShouldBeOfType(typeof(ArgumentOutOfRangeException));
}
diff --git a/src/Mapster.Tests/WhenScanningForRegisters.cs b/src/Mapster.Tests/WhenScanningForRegisters.cs
index a69323f7..0264e57e 100644
--- a/src/Mapster.Tests/WhenScanningForRegisters.cs
+++ b/src/Mapster.Tests/WhenScanningForRegisters.cs
@@ -4,7 +4,7 @@
using Mapster.Models;
using Mapster.Tests.Classes;
using NUnit.Framework;
-using Should;
+using Shouldly;
namespace Mapster.Tests
{
@@ -21,7 +21,7 @@ public void Setup()
public void Registers_Are_Found()
{
IList registers = TypeAdapterConfig.GlobalSettings.Scan(Assembly.GetExecutingAssembly());
- registers.Count.ShouldEqual(2);
+ registers.Count.ShouldBe(2);
var typeTuples = TypeAdapterConfig.GlobalSettings.RuleMap.Keys.ToList();
diff --git a/src/Mapster.Tests/WhenUsingConverterFactory.cs b/src/Mapster.Tests/WhenUsingConverterFactory.cs
index 8bc3e5ab..511e9b3b 100644
--- a/src/Mapster.Tests/WhenUsingConverterFactory.cs
+++ b/src/Mapster.Tests/WhenUsingConverterFactory.cs
@@ -1,6 +1,6 @@
using System;
using NUnit.Framework;
-using Should;
+using Shouldly;
namespace Mapster.Tests
{
@@ -16,12 +16,12 @@ public void Custom_Mapping_From_String_To_Char_Array()
var chars = TypeAdapter.Adapt("Hello");
- chars.Length.ShouldEqual(5);
- chars[0].ShouldEqual('H');
- chars[1].ShouldEqual('e');
- chars[2].ShouldEqual('l');
- chars[3].ShouldEqual('l');
- chars[4].ShouldEqual('o');
+ chars.Length.ShouldBe(5);
+ chars[0].ShouldBe('H');
+ chars[1].ShouldBe('e');
+ chars[2].ShouldBe('l');
+ chars[3].ShouldBe('l');
+ chars[4].ShouldBe('o');
}
}
}
\ No newline at end of file
diff --git a/src/Mapster.Tests/WhenUsingNonDefaultConstructor.cs b/src/Mapster.Tests/WhenUsingNonDefaultConstructor.cs
index 751e6384..abb5621f 100644
--- a/src/Mapster.Tests/WhenUsingNonDefaultConstructor.cs
+++ b/src/Mapster.Tests/WhenUsingNonDefaultConstructor.cs
@@ -1,6 +1,6 @@
using System;
using NUnit.Framework;
-using Should;
+using Shouldly;
namespace Mapster.Tests
{
@@ -20,9 +20,9 @@ public void Dest_Calls_Calls_Non_Default_Constructor_With_ConstructUsing()
var dto = TypeAdapter.Adapt(simplePoco);
- dto.Id.ShouldEqual(simplePoco.Id);
- dto.Name.ShouldEqual(simplePoco.Name);
- dto.Unmapped.ShouldEqual("unmapped");
+ dto.Id.ShouldBe(simplePoco.Id);
+ dto.Name.ShouldBe(simplePoco.Name);
+ dto.Unmapped.ShouldBe("unmapped");
}
[Test]
@@ -37,9 +37,9 @@ public void Dest_Calls_Calls_Factory_Method_With_ConstructUsing()
var dto = TypeAdapter.Adapt(simplePoco);
- dto.Id.ShouldEqual(simplePoco.Id);
- dto.Name.ShouldEqual(simplePoco.Name);
- dto.Unmapped.ShouldEqual("unmapped");
+ dto.Id.ShouldBe(simplePoco.Id);
+ dto.Name.ShouldBe(simplePoco.Name);
+ dto.Unmapped.ShouldBe("unmapped");
}
diff --git a/src/Mapster.Tests/WhenUsingRuleBasedSetting.cs b/src/Mapster.Tests/WhenUsingRuleBasedSetting.cs
index f0f1ebd3..e9565057 100644
--- a/src/Mapster.Tests/WhenUsingRuleBasedSetting.cs
+++ b/src/Mapster.Tests/WhenUsingRuleBasedSetting.cs
@@ -1,6 +1,6 @@
using System;
using NUnit.Framework;
-using Should;
+using Shouldly;
namespace Mapster.Tests
{
@@ -18,8 +18,8 @@ public void Rule_Base_Testing()
var dto = TypeAdapter.Adapt(simplePoco);
- dto.Id.ShouldEqual(Guid.Empty);
- dto.Name.ShouldEqual(simplePoco.Name);
+ dto.Id.ShouldBe(Guid.Empty);
+ dto.Name.ShouldBe(simplePoco.Name);
}
#region TestClasses
diff --git a/src/Mapster.Tests/packages.config b/src/Mapster.Tests/packages.config
index 66a64b0d..4d96bbbf 100644
--- a/src/Mapster.Tests/packages.config
+++ b/src/Mapster.Tests/packages.config
@@ -1,6 +1,5 @@
-
-
+
\ No newline at end of file
diff --git a/src/Mapster/Mapster.csproj b/src/Mapster/Mapster.csproj
index 038af29b..bc73e13c 100644
--- a/src/Mapster/Mapster.csproj
+++ b/src/Mapster/Mapster.csproj
@@ -39,6 +39,12 @@
1124073472
+
+ true
+
+
+ Mapster.snk
+
@@ -93,6 +99,7 @@
+
diff --git a/src/Mapster/Mapster.snk b/src/Mapster/Mapster.snk
new file mode 100644
index 00000000..c848c294
Binary files /dev/null and b/src/Mapster/Mapster.snk differ
diff --git a/src/Mapster/Properties/AssemblyInfo.cs b/src/Mapster/Properties/AssemblyInfo.cs
index 4cb39396..54aeddb0 100644
--- a/src/Mapster/Properties/AssemblyInfo.cs
+++ b/src/Mapster/Properties/AssemblyInfo.cs
@@ -34,4 +34,4 @@
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("2.1.0")]
[assembly: AssemblyFileVersion("2.1.0")]
-[assembly: InternalsVisibleTo("Mapster.Tests")]
+[assembly: InternalsVisibleTo("Mapster.Tests, PublicKey=00240000048000009400000006020000002400005253413100040000010001000936c652e8d888894759aa92c40f62c30d691cb153214c6ddff550ee7b68b320eefeed3fceef9a7cea5cfce035983b4d6c22ea7a925e375116cdf8f6ea6259ebe263fbd9a1332037e5f7da63df86124223c81667c86b387372aa769a145ddadb378ba6dfe2b4f4266c89eb54b477938ba265321fa77f953f2abaacfed62e66bd")]
diff --git a/src/Mapster/project.json b/src/Mapster/project.json
index 7b9faf4c..527dfa17 100644
--- a/src/Mapster/project.json
+++ b/src/Mapster/project.json
@@ -1,27 +1,29 @@
{
- "version": "2.2.0-beta",
- "description": "A fast, fun and stimulating object to object mapper. Kind of like AutoMapper, just simpler and way, way faster.",
- "summary": "A fast, fun and stimulating object to object mapper. Kind of like AutoMapper, but simpler and way faster.",
- "iconUrl": "http://www.fancyicons.com/free-icons/103/pretty-office-5/png/128/order_128.png",
- "authors": [ "chaowlert", "eric_swann" ],
- "tags": [ "Mapper", "AutoMapper", "Fast", "Mapping" ],
- "projectUrl": "https://github.com/chaowlert/Mapster",
- "licenseUrl": "https://github.com/chaowlert/Mapster/blob/master/LICENSE",
- "copyright": "Copyright (c) 2016 Chaowlert Chaisrichalermpol, Eric Swann",
-
- "frameworks": {
- "net4": {
- "compilationOptions": {
- "define": [ "NET4" ]
- }
+ "version": "2.3.0",
+ "description": "A fast, fun and stimulating object to object mapper. Kind of like AutoMapper, just simpler and way, way faster.",
+ "summary": "A fast, fun and stimulating object to object mapper. Kind of like AutoMapper, but simpler and way faster.",
+ "iconUrl": "http://www.fancyicons.com/free-icons/103/pretty-office-5/png/128/order_128.png",
+ "authors": [ "chaowlert", "eric_swann" ],
+ "tags": [ "Mapper", "AutoMapper", "Fast", "Mapping" ],
+ "projectUrl": "https://github.com/chaowlert/Mapster",
+ "licenseUrl": "https://github.com/chaowlert/Mapster/blob/master/LICENSE",
+ "copyright": "Copyright (c) 2016 Chaowlert Chaisrichalermpol, Eric Swann",
+ "compilationOptions": {
+ "keyFile": "Mapster.snk"
},
- "net45": { },
- "dotnet5.4": {
- "dependencies": {
- "Microsoft.CSharp": "4.0.0",
- "System.Collections.NonGeneric": "4.0.0",
- "System.Linq.Queryable": "4.0.0"
- }
+ "frameworks": {
+ "net4": {
+ "compilationOptions": {
+ "define": [ "NET4" ]
+ }
+ },
+ "net45": { },
+ "dotnet5.4": {
+ "dependencies": {
+ "Microsoft.CSharp": "4.0.0",
+ "System.Collections.NonGeneric": "4.0.0",
+ "System.Linq.Queryable": "4.0.0"
+ }
+ }
}
- }
}