Browse Source

移除项目

懒得勤快 5 years ago
parent
commit
8be07e1d86
22 changed files with 25 additions and 1705 deletions
  1. 2 0
      .gitignore
  2. 0 7
      Masuit.Tools.sln
  3. 17 420
      README.md
  4. 0 23
      Test/Masuit.Tools.Abstractions.Test/Mapping/ClassTests/ClassDest.cs
  5. 0 11
      Test/Masuit.Tools.Abstractions.Test/Mapping/ClassTests/ClassDest2.cs
  6. 0 21
      Test/Masuit.Tools.Abstractions.Test/Mapping/ClassTests/ClassSource.cs
  7. 0 10
      Test/Masuit.Tools.Abstractions.Test/Mapping/ClassTests/ClassSource2.cs
  8. 0 10
      Test/Masuit.Tools.Abstractions.Test/Mapping/ClassTests/IClassDest2.cs
  9. 0 59
      Test/Masuit.Tools.Abstractions.Test/Mapping/ClassTests/MapperConfigurationTestContainer.cs
  10. 0 62
      Test/Masuit.Tools.Abstractions.Test/Mapping/ClassTests/QueryableImplTest.cs
  11. 0 140
      Test/Masuit.Tools.Abstractions.Test/Mapping/Core/ConverterExpressionVisitorTest.cs
  12. 0 86
      Test/Masuit.Tools.Abstractions.Test/Mapping/Core/MapperConfigurationBaseTests.cs
  13. 0 212
      Test/Masuit.Tools.Abstractions.Test/Mapping/Core/MapperConfigurationTests.cs
  14. 0 35
      Test/Masuit.Tools.Abstractions.Test/Mapping/Core/MapperContainerTest.cs
  15. 0 89
      Test/Masuit.Tools.Abstractions.Test/Mapping/Core/MapperExpressionVisitorTest.cs
  16. 0 46
      Test/Masuit.Tools.Abstractions.Test/Mapping/Extentions/MapperExtentionsTest.cs
  17. 0 77
      Test/Masuit.Tools.Abstractions.Test/Mapping/Extentions/QueryableExtentionsTest.cs
  18. 0 118
      Test/Masuit.Tools.Abstractions.Test/Mapping/MapperTests.cs
  19. 6 0
      Test/Masuit.Tools.Abstractions.Test/Masuit.Tools.Abstractions.Test.csproj
  20. 0 26
      Test/Masuit.Tools.ExpressionMapperBenchmark/Masuit.Tools.ExpressionMapperBenchmark.csproj
  21. 0 205
      Test/Masuit.Tools.ExpressionMapperBenchmark/Program.cs
  22. 0 48
      Test/Masuit.Tools.ExpressionMapperBenchmark/TestClassA.cs

+ 2 - 0
.gitignore

@@ -247,3 +247,5 @@ ModelManifest.xml
 /Masuit.Tools.Abstractions.xml
 /Masuit.Tools.Abstractions/Reflection/ClassHelper.cs
 /Masuit.Tools.Abstractions/Mapping
+/Test/Masuit.Tools.Abstractions.Test/Mapping
+/Test/Masuit.Tools.ExpressionMapperBenchmark

+ 0 - 7
Masuit.Tools.sln

@@ -26,8 +26,6 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution
 EndProject
 Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masuit.Tools.AspNetCore.ResumeFileResults.WebTest", "Test\Masuit.Tools.AspNetCore.ResumeFileResults.WebTest\Masuit.Tools.AspNetCore.ResumeFileResults.WebTest.csproj", "{99185F12-DFAD-4DB8-A2C4-C7E9700C0A31}"
 EndProject
-Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masuit.Tools.ExpressionMapperBenchmark", "Test\Masuit.Tools.ExpressionMapperBenchmark\Masuit.Tools.ExpressionMapperBenchmark.csproj", "{B5657BBC-E50E-4CAD-B78B-6E2CCB139F98}"
-EndProject
 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Masuit.Tools.Test", "Test\Masuit.Tools.Test\Masuit.Tools.Test.csproj", "{AB9F4635-0ACB-4E5E-8E1B-431E0818CF60}"
 EndProject
 Global
@@ -68,10 +66,6 @@ Global
 		{99185F12-DFAD-4DB8-A2C4-C7E9700C0A31}.Debug|Any CPU.Build.0 = Debug|Any CPU
 		{99185F12-DFAD-4DB8-A2C4-C7E9700C0A31}.Release|Any CPU.ActiveCfg = Release|Any CPU
 		{99185F12-DFAD-4DB8-A2C4-C7E9700C0A31}.Release|Any CPU.Build.0 = Release|Any CPU
-		{B5657BBC-E50E-4CAD-B78B-6E2CCB139F98}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
-		{B5657BBC-E50E-4CAD-B78B-6E2CCB139F98}.Debug|Any CPU.Build.0 = Debug|Any CPU
-		{B5657BBC-E50E-4CAD-B78B-6E2CCB139F98}.Release|Any CPU.ActiveCfg = Release|Any CPU
-		{B5657BBC-E50E-4CAD-B78B-6E2CCB139F98}.Release|Any CPU.Build.0 = Release|Any CPU
 		{AB9F4635-0ACB-4E5E-8E1B-431E0818CF60}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
 		{AB9F4635-0ACB-4E5E-8E1B-431E0818CF60}.Debug|Any CPU.Build.0 = Debug|Any CPU
 		{AB9F4635-0ACB-4E5E-8E1B-431E0818CF60}.Release|Any CPU.ActiveCfg = Release|Any CPU
@@ -84,7 +78,6 @@ Global
 		{B8BFA5B2-20BF-4D9C-A9F3-5E33EC6A0B20} = {E0B8FBD1-A28A-4420-9DE2-6BD06035CBAC}
 		{61430D45-3808-49B5-BDF3-4536DA399DD4} = {E0B8FBD1-A28A-4420-9DE2-6BD06035CBAC}
 		{99185F12-DFAD-4DB8-A2C4-C7E9700C0A31} = {E0B8FBD1-A28A-4420-9DE2-6BD06035CBAC}
-		{B5657BBC-E50E-4CAD-B78B-6E2CCB139F98} = {E0B8FBD1-A28A-4420-9DE2-6BD06035CBAC}
 		{AB9F4635-0ACB-4E5E-8E1B-431E0818CF60} = {E0B8FBD1-A28A-4420-9DE2-6BD06035CBAC}
 	EndGlobalSection
 	GlobalSection(ExtensibilityGlobals) = postSolution

+ 17 - 420
README.md

@@ -412,411 +412,8 @@ var list = new List<MyClass>()
 List<MyClass> classes = list.DistinctBy(c => c.Email).ToList();
 Console.WriteLine(classes.Count==1);//True
 ```
-### 25.对象实体映射
-在使用前需要像automapper那样,对mapper进行初始化操作
-```csharp
-using Masuit.Tools.Mapping;
-```
-```csharp
-ExpressionMapper.CreateMap<ClassA, ClassADto>();// 默认关系映射
-ExpressionMapper.CreateMap<ClassB, ClassBDto>().ForMember(s => s.ClassC.PropertyName, d => d.CustomName, true);// 自定义关系映射
-
-ExpressionMapper.ConstructServicesUsing((x) => DependencyResolver.Current.GetService(x));// 使用依赖注入容器进行构造映射
-//ExpressionMapper.ConstructServicesUsing((x) => ServiceLocator.Current.GetInstance(x));// 使用依赖注入容器进行构造映射
-ExpressionMapper.CreateMap<Product, IProduct>().ConstructUsingServiceLocator().ReverseMap();// 链式自定义关系映射和反向映射
-```
-测试class:
-<details>
-    <summary>点击查看代码</summary>
-    
-```csharp
-public class TestClassA
-{
-    public string MyProperty { get; set; }
-    public int Int { get; set; }
-    public double Double { get; set; }
-    public DateTime DateTime { get; set; }
-    public TestClassC TestClassC { get; set; }
-    public List<TestClassC> List { get; set; }
-}
-
-public class TestClassB
-{
-    public string MyProperty { get; set; }
-    public int Int { get; set; }
-    public double Double { get; set; }
-    public DateTime DateTime { get; set; }
-    public TestClassC TestClassC { get; set; }
-    public List<TestClassD> List { get; set; }
-}
-
-public class TestClassC
-{
-    public string MyProperty { get; set; }
-    public int Int { get; set; }
-    public double Double { get; set; }
-    public DateTime DateTime { get; set; }
-    public TestClassD Obj { get; set; }
-}
-
-public class TestClassD
-{
-    public string MyProperty { get; set; }
-    public int Int { get; set; }
-    public double Double { get; set; }
-    public DateTime DateTime { get; set; }
-    public TestClassC Obj { get; set; }
-}
-```
-</details>
-
-构造一个结构相对复杂的对象:
-<details>
-    <summary>点击查看代码</summary>
-    
-```csharp
-var a = new TestClassA()
-{
-    MyProperty = "ssssssssssssssssssssss",
-    DateTime = DateTime.Now,
-    Double = 123.33,
-    Int = 100,
-    TestClassC = new TestClassC()
-    {
-        MyProperty = "ccccccccccccccccccccccccccc",
-        DateTime = DateTime.Now,
-        Double = 2345.555,
-        Int = 10100,
-        Obj = new TestClassD()
-        {
-            MyProperty = "ddddddddddddddddddddddddd",
-            Obj = new TestClassC()
-            {
-                MyProperty = "cccccc",
-                DateTime = DateTime.Now,
-                Double = 23458894.555,
-                Int = 10100000,
-                Obj = new TestClassD()
-            }
-        }
-    },
-    List = new List<TestClassC>()
-    {
-        new TestClassC()
-        {
-            MyProperty = "cccccc",
-            DateTime = DateTime.Now,
-            Double = 2345.555,
-            Int = 10100,
-            Obj = new TestClassD()
-            {
-                MyProperty = "ddddddddddddddddddddddddddddddddddd",
-                DateTime = DateTime.Now,
-                Double = 2345.555,
-                Int = 10100,
-                Obj = new TestClassC()
-                {
-                    MyProperty = "cccccccccccccccccccccccccccccc",
-                    DateTime = DateTime.Now,
-                    Double = 2345.555,
-                    Int = 10100,
-                    Obj = new TestClassD()
-                }
-            }
-        },
-        new TestClassC()
-        {
-            MyProperty = "cccccc",
-            DateTime = DateTime.Now,
-            Double = 2345.555,
-            Int = 10100,
-            Obj = new TestClassD()
-            {
-                MyProperty = "ddddddddddddddddddddddddddddddddddd",
-                DateTime = DateTime.Now,
-                Double = 2345.555,
-                Int = 10100,
-                Obj = new TestClassC()
-                {
-                    MyProperty = "cccccccccccccccccccccccccccccc",
-                    DateTime = DateTime.Now,
-                    Double = 2345.555,
-                    Int = 10100,
-                    Obj = new TestClassD()
-                }
-            }
-        },
-        new TestClassC()
-        {
-            MyProperty = "cccccc",
-            DateTime = DateTime.Now,
-            Double = 2345.555,
-            Int = 10100,
-            Obj = new TestClassD()
-            {
-                MyProperty = "ddddddddddddddddddddddddddddddddddd",
-                DateTime = DateTime.Now,
-                Double = 2345.555,
-                Int = 10100,
-                Obj = new TestClassC()
-                {
-                    MyProperty = "cccccccccccccccccccccccccccccc",
-                    DateTime = DateTime.Now,
-                    Double = 2345.555,
-                    Int = 10100,
-                    Obj = new TestClassD()
-                }
-            }
-        },
-        new TestClassC()
-        {
-            MyProperty = "cccccc",
-            DateTime = DateTime.Now,
-            Double = 2345.555,
-            Int = 10100,
-            Obj = new TestClassD()
-            {
-                MyProperty = "ddddddddddddddddddddddddddddddddddd",
-                DateTime = DateTime.Now,
-                Double = 2345.555,
-                Int = 10100,
-                Obj = new TestClassC()
-                {
-                    MyProperty = "cccccccccccccccccccccccccccccc",
-                    DateTime = DateTime.Now,
-                    Double = 2345.555,
-                    Int = 10100,
-                    Obj = new TestClassD()
-                }
-            }
-        },
-        new TestClassC()
-        {
-            MyProperty = "cccccc",
-            DateTime = DateTime.Now,
-            Double = 2345.555,
-            Int = 10100,
-            Obj = new TestClassD()
-            {
-                MyProperty = "ddddddddddddddddddddddddddddddddddd",
-                DateTime = DateTime.Now,
-                Double = 2345.555,
-                Int = 10100,
-                Obj = new TestClassC()
-                {
-                    MyProperty = "cccccccccccccccccccccccccccccc",
-                    DateTime = DateTime.Now,
-                    Double = 2345.555,
-                    Int = 10100,
-                    Obj = new TestClassD()
-                }
-            }
-        },
-    }
-};
-var b = a.Map<TestClassA, TestClassB>();
-```
-</details>
-
-性能测试:i7-4700H+12GB DDR3
-<details>
-    <summary>点击查看代码</summary>
-
-```csharp
-#region 配置automapper
-
-Mapper.Initialize(e =>
-{
-    e.CreateMap<TestClassA, TestClassB>().ReverseMap();
-    e.CreateMap<TestClassC, TestClassD>().ReverseMap();
-});
-
-#endregion
-
-#region 配置ExpressionMapper
-
-ExpressionMapper.CreateMap<TestClassA, TestClassB>().ReverseMap();
-ExpressionMapper.CreateMap<TestClassC, TestClassD>().ReverseMap();
-
-#endregion
-
-#region 造一个大对象
-
-var a = new TestClassA()
-{
-    MyProperty = "ssssssssssssssssssssss",
-    DateTime = DateTime.Now,
-    Double = 123.33,
-    Int = 100,
-    TestClassC = new TestClassC()
-    {
-        MyProperty = "ccccccccccccccccccccccccccc",
-        DateTime = DateTime.Now,
-        Double = 2345.555,
-        Int = 10100,
-        Obj = new TestClassD()
-        {
-            MyProperty = "ddddddddddddddddddddddddd",
-            Obj = new TestClassC()
-            {
-                MyProperty = "cccccc",
-                DateTime = DateTime.Now,
-                Double = 23458894.555,
-                Int = 10100000,
-                Obj = new TestClassD()
-            }
-        }
-    },
-    List = new List<TestClassC>()
-    {
-        new TestClassC()
-        {
-            MyProperty = "cccccc",
-            DateTime = DateTime.Now,
-            Double = 2345.555,
-            Int = 10100,
-            Obj = new TestClassD()
-            {
-                MyProperty = "ddddddddddddddddddddddddddddddddddd",
-                DateTime = DateTime.Now,
-                Double = 2345.555,
-                Int = 10100,
-                Obj = new TestClassC()
-                {
-                    MyProperty = "cccccccccccccccccccccccccccccc",
-                    DateTime = DateTime.Now,
-                    Double = 2345.555,
-                    Int = 10100,
-                    Obj = new TestClassD()
-                }
-            }
-        },
-        new TestClassC()
-        {
-            MyProperty = "cccccc",
-            DateTime = DateTime.Now,
-            Double = 2345.555,
-            Int = 10100,
-            Obj = new TestClassD()
-            {
-                MyProperty = "ddddddddddddddddddddddddddddddddddd",
-                DateTime = DateTime.Now,
-                Double = 2345.555,
-                Int = 10100,
-                Obj = new TestClassC()
-                {
-                    MyProperty = "cccccccccccccccccccccccccccccc",
-                    DateTime = DateTime.Now,
-                    Double = 2345.555,
-                    Int = 10100,
-                    Obj = new TestClassD()
-                }
-            }
-        },
-        new TestClassC()
-        {
-            MyProperty = "cccccc",
-            DateTime = DateTime.Now,
-            Double = 2345.555,
-            Int = 10100,
-            Obj = new TestClassD()
-            {
-                MyProperty = "ddddddddddddddddddddddddddddddddddd",
-                DateTime = DateTime.Now,
-                Double = 2345.555,
-                Int = 10100,
-                Obj = new TestClassC()
-                {
-                    MyProperty = "cccccccccccccccccccccccccccccc",
-                    DateTime = DateTime.Now,
-                    Double = 2345.555,
-                    Int = 10100,
-                    Obj = new TestClassD()
-                }
-            }
-        },
-        new TestClassC()
-        {
-            MyProperty = "cccccc",
-            DateTime = DateTime.Now,
-            Double = 2345.555,
-            Int = 10100,
-            Obj = new TestClassD()
-            {
-                MyProperty = "ddddddddddddddddddddddddddddddddddd",
-                DateTime = DateTime.Now,
-                Double = 2345.555,
-                Int = 10100,
-                Obj = new TestClassC()
-                {
-                    MyProperty = "cccccccccccccccccccccccccccccc",
-                    DateTime = DateTime.Now,
-                    Double = 2345.555,
-                    Int = 10100,
-                    Obj = new TestClassD()
-                }
-            }
-        },
-        new TestClassC()
-        {
-            MyProperty = "cccccc",
-            DateTime = DateTime.Now,
-            Double = 2345.555,
-            Int = 10100,
-            Obj = new TestClassD()
-            {
-                MyProperty = "ddddddddddddddddddddddddddddddddddd",
-                DateTime = DateTime.Now,
-                Double = 2345.555,
-                Int = 10100,
-                Obj = new TestClassC()
-                {
-                    MyProperty = "cccccccccccccccccccccccccccccc",
-                    DateTime = DateTime.Now,
-                    Double = 2345.555,
-                    Int = 10100,
-                    Obj = new TestClassD()
-                }
-            }
-        },
-    }
-};
-
-#endregion
-
-var time = HiPerfTimer.Execute(() =>
-{
-    a.Map<TestClassA, TestClassB>();
-    a.Map<TestClassA, TestClassB>();
-});// 因为第一次需要编译表达式树,所以测试两次
-Console.WriteLine($"ExpressionMapper映射2次耗时:{time}s");// 0.0270508s
-time = HiPerfTimer.Execute(() =>
-{
-    for (int i = 0; i < 1000000; i++)
-    {
-        var b = a.Map<TestClassA, TestClassB>();
-    }
-});
-Console.WriteLine($"ExpressionMapper映射1000000次耗时:{time}s");// 1.206569s
-
-time = HiPerfTimer.Execute(() =>
-{
-    Mapper.Map<TestClassB>(a);
-    Mapper.Map<TestClassB>(a);
-});// 映射2次为了和ExpressionMapper保持相同情况
-Console.WriteLine($"AutoMapper映射2次耗时:{time}s");// 0.0281503s
-time = HiPerfTimer.Execute(() =>
-{
-    for (int i = 0; i < 1000000; i++)
-    {
-        var b = Mapper.Map<TestClassB>(a);
-    }
-});
-Console.WriteLine($"AutoMapper映射1000000次耗时:{time}s");// 4.1858825s
-```
-</details>
 
-### 26.枚举扩展
+### 25.枚举扩展
 ```csharp
 public enum MyEnum
 {
@@ -837,12 +434,12 @@ string display = MyEnum.Read.GetDisplay();// 获取Display标签的Name属性
 var value = typeof(MyEnum).GetValue("Read");//获取字符串表示值对应的枚举值
 string enumString = 0.ToEnumString(typeof(MyEnum));// 获取枚举值对应的字符串表示
 ```
-### 27.定长队列实现
+### 26.定长队列实现
 ```csharp
 LimitedQueue<string> queue = new LimitedQueue<string>(32);// 声明一个容量为32个元素的定长队列
 ConcurrentLimitedQueue<string> queue = new ConcurrentLimitedQueue<string>(32);// 声明一个容量为32个元素的线程安全的定长队列
 ```
-### 28.反射操作
+### 27.反射操作
 ```csharp
 MyClass myClass = new MyClass();
 PropertyInfo[] properties = myClass.GetProperties();// 获取属性列表
@@ -858,12 +455,12 @@ var mc = myClass.AddProperty(new List<ClassHelper.CustPropertyInfo>()
 object newObj = mc.DeleteProperty(new List<string>() { "Email", "Age", "IP", "PhoneNumber" });// 删除属性
 Console.WriteLine(newObj.ToJsonString());// {"Password":null,"Name":"张三","Number":123456.0}
 ```
-### 29.获取线程内唯一对象
+### 28.获取线程内唯一对象
 ```csharp
 CallContext<T>.SetData("db",dbContext);//设置线程内唯一对象
 CallContext<T>.GetData("db");//获取线程内唯一对象
 ```
-### 30.asp.net core 获取静态的HttpContext对象
+### 29.asp.net core 获取静态的HttpContext对象
 Startup.cs
 ```csharp
 public void ConfigureServices(IServiceCollection services)
@@ -887,7 +484,7 @@ public async Task<IActionResult> Index()
     HttpContext context = HttpContext2.Current;
 }
 ```
-### 31.邮件发送
+### 30.邮件发送
 ```csharp
 new Email()
 {
@@ -904,7 +501,7 @@ new Email()
     Console.WriteLine(s);// 发送成功后的回调
 });// 异步发送邮件
 ```
-### 32.图像的简单处理
+### 31.图像的简单处理
 ```csharp
 ImageUtilities.CompressImage(@"F:\src\1.jpg", @"F:\dest\2.jpg");//无损压缩图片
 
@@ -919,13 +516,13 @@ Bitmap newBmp = bmp.CutAndResize(new Rectangle(0, 0, 1600, 900), 160, 90);//裁
 bmp.RevPicLR(bmp.Width, bmp.Height);//左右镜像
 bmp.RevPicUD(bmp.Width, bmp.Height);//上下镜像
 ```
-### 33.随机数
+### 32.随机数
 ```csharp
 Random rnd = new Random();
 int num = rnd.StrictNext();//产生真随机数
 double gauss = rnd.NextGauss(20,5);//产生正态分布的随机数
 ```
-### 34.权重筛选功能
+### 33.权重筛选功能
 ```csharp
 var data=new List<WeightedItem<string>>()
 {
@@ -948,7 +545,7 @@ var selector = new WeightedSelector<string>(new List<WeightedItem<string>>()
 var item = selector.Select();//按权重选出1个元素
 var list = selector.SelectMultiple(3);//按权重选出3个元素
 ```
-### 35.EF Core支持AddOrUpdate方法
+### 34.EF Core支持AddOrUpdate方法
 ```csharp
 /// <summary>
 /// 按Id添加或更新文章实体
@@ -959,12 +556,12 @@ public override Post SavePost(Post t)
     return t;
 }
 ```
-### 38.敏感信息掩码
+### 35.敏感信息掩码
 ```csharp
 "13123456789".Mask(); // 131****5678
 "[email protected]".MaskEmail(); // a****[email protected]
 ```
-### 39.集合扩展
+### 36.集合扩展
 ```csharp
 var list = new List<string>()
 {
@@ -992,13 +589,13 @@ table.HasRows(); // 检查DataTable 是否有数据行
 table.ToList<T>(); // datatable转List
 var set = list.ToHashSet(s=>s.Name);// 转HashSet
 ```
-### 40.Mime类型
+### 37.Mime类型
 ```csharp
 var mimeMapper = new MimeMapper();
 var mime = mimeMapper.GetExtensionFromMime("image/jpeg"); // .jpg
 var ext = mimeMapper.GetMimeFromExtension(".jpg"); // image/jpeg
 ```
-### 41.日期时间扩展
+### 38.日期时间扩展
 ```csharp
 DateTime.Now.GetTotalSeconds(); // 获取该时间相对于1970-01-01 00:00:00的秒数
 DateTime.Now.GetTotalMilliseconds(); // 获取该时间相对于1970-01-01 00:00:00的毫秒数
@@ -1014,18 +611,18 @@ var (intersected,range2) = range.Intersect(DateTime.Parse("2020-8-4"), DateTime.
 range.Contains(DateTime.Parse("2020-8-3"), DateTime.Parse("2020-8-4"));//判断是否包含某个时间段,true
 ...
 ```
-### 42.流转换
+### 39.流转换
 ```csharp
 stream.SaveAsMemoryStream(); // 任意流转换成内存流
 stream.ToArray(); // 任意流转换成二进制数组
 ```
-### 43.数值转换
+### 40.数值转换
 ```csharp
 1.2345678901.Digits8(); // 将小数截断为8位
 1.23.To<int>(); // 小数转int
 1.23.To<T>(); // 小数转T基本类型
 ```
-### 44.简繁转换
+### 41.简繁转换
 ```csharp
 var str="个体".ToTraditional(); // 转繁体
 var str="個體".ToSimplified(); // 转简体

+ 0 - 23
Test/Masuit.Tools.Abstractions.Test/Mapping/ClassTests/ClassDest.cs

@@ -1,23 +0,0 @@
-using System.Collections.Generic;
-
-namespace Masuit.Tools.Abstractions.Test.Mapping.ClassTests
-{
-    public class ClassDest
-    {
-        public int PropInt1 { get; set; }
-        public int PropInt2 { get; set; }
-
-        public string PropString { get; set; }
-        public string PropString2 { get; set; }
-
-        public int RealOnlyPropInt1 { get; }
-
-        public ClassDest2 ClassDestEntityBase { get; set; }
-        public List<ClassDest2> ListProp { get; set; }
-
-        public List<string> ListString { get; set; }
-        public ClassDest2 SubClass { get; set; }
-        public ClassDest2 SubClass2 { get; set; }
-        public int CountListProp { get; set; }
-    }
-}

+ 0 - 11
Test/Masuit.Tools.Abstractions.Test/Mapping/ClassTests/ClassDest2.cs

@@ -1,11 +0,0 @@
-namespace Masuit.Tools.Abstractions.Test.Mapping.ClassTests
-{
-    public class ClassDest2 : IClassDest2
-    {
-        public int PropInt1 { get; set; }
-        public int PropInt2 { get; set; }
-        public string PropString2 { get; set; }
-
-        public ClassSource ClassSourceProp { get; set; }
-    }
-}

+ 0 - 21
Test/Masuit.Tools.Abstractions.Test/Mapping/ClassTests/ClassSource.cs

@@ -1,21 +0,0 @@
-using System.Collections.Generic;
-
-namespace Masuit.Tools.Abstractions.Test.Mapping.ClassTests
-{
-    public class ClassSource
-    {
-        public int PropInt1 { get; set; }
-        public int PropSourceInt1 { get; set; }
-        public string PropString1 { get; set; }
-
-        public string PropString { get; set; }
-
-        public string PropString2 { get; set; }
-        public List<ClassSource2> ListProp { get; set; }
-
-        public List<string> ListString { get; set; }
-        public ClassSource Same { get; set; }
-
-        public ClassSource2 SubClass { get; set; }
-    }
-}

+ 0 - 10
Test/Masuit.Tools.Abstractions.Test/Mapping/ClassTests/ClassSource2.cs

@@ -1,10 +0,0 @@
-namespace Masuit.Tools.Abstractions.Test.Mapping.ClassTests
-{
-    public class ClassSource2
-    {
-        public int PropInt1 { get; set; }
-        public int PropSourceInt1 { get; set; }
-        public string PropString1 { get; set; }
-        public ClassSource SameParent { get; set; }
-    }
-}

+ 0 - 10
Test/Masuit.Tools.Abstractions.Test/Mapping/ClassTests/IClassDest2.cs

@@ -1,10 +0,0 @@
-namespace Masuit.Tools.Abstractions.Test.Mapping.ClassTests
-{
-    public interface IClassDest2
-    {
-        ClassSource ClassSourceProp { get; set; }
-        int PropInt1 { get; set; }
-        int PropInt2 { get; set; }
-        string PropString2 { get; set; }
-    }
-}

+ 0 - 59
Test/Masuit.Tools.Abstractions.Test/Mapping/ClassTests/MapperConfigurationTestContainer.cs

@@ -1,59 +0,0 @@
-using Masuit.Tools.Mapping.Core;
-using System;
-using System.Linq.Expressions;
-using System.Reflection;
-
-namespace Masuit.Tools.Abstractions.Test.Mapping.ClassTests
-{
-    public class MapperConfigurationTestContainer : MapperConfiguration<ClassSource, ClassDest>
-    {
-        public MapperConfigurationTestContainer() : base("sTest")
-        {
-        }
-
-        public int GetIgnoreCount()
-        {
-            return PropertiesToIgnore.Count;
-        }
-
-        public int GetAfterMapActionCount()
-        {
-            return actionsAfterMap.Count;
-        }
-
-        public MapperConfigurationBase GetMapperTest(Type tSource, Type tDest, bool throwExceptionOnNoFound)
-        {
-            return GetMapper(tSource, tDest, throwExceptionOnNoFound);
-        }
-
-        public void CheckAndConfigureMappingTest(Tuple<Expression, Expression, bool, string> configExpression)
-        {
-            CheckAndConfigureMapping(ref configExpression);
-        }
-
-        public PropertyInfo GetPropertyInfoTest(LambdaExpression expression)
-        {
-            return GetPropertyInfo(expression);
-        }
-
-        public void CreateCommonMemberTest()
-        {
-            CreateCommonMember();
-        }
-
-        public void CheckAndRemoveMemberDestTest(string propertyName)
-        {
-            CheckAndRemoveMemberDest(propertyName);
-        }
-
-        public void CreateMemberAssignementForExistingTargetTest()
-        {
-            CreateMemberAssignementForExistingTarget();
-        }
-
-        public Delegate GetDelegateForExistingTargetTest()
-        {
-            return GetDelegateForExistingTarget();
-        }
-    }
-}

+ 0 - 62
Test/Masuit.Tools.Abstractions.Test/Mapping/ClassTests/QueryableImplTest.cs

@@ -1,62 +0,0 @@
-using System;
-using System.Collections;
-using System.Collections.Generic;
-using System.Linq;
-using System.Linq.Expressions;
-
-namespace Masuit.Tools.Abstractions.Test.Mapping.ClassTests
-{
-    public class QueryableImplTest<T> : IOrderedQueryable<T>
-    {
-        public QueryableImplTest()
-        {
-            Provider = new QueryProviderImplTest();
-            Expression = Expression.Constant(this);
-        }
-
-        public QueryableImplTest(Expression expression)
-        : this()
-        {
-            Expression = expression;
-        }
-
-        public Type ElementType => typeof(T);
-
-        public Expression Expression { get; }
-
-        public IQueryProvider Provider { get; }
-
-        public IEnumerator<T> GetEnumerator()
-        {
-            return Provider.CreateQuery<T>(Expression).GetEnumerator();
-        }
-
-        IEnumerator IEnumerable.GetEnumerator()
-        {
-            return Provider.CreateQuery<T>(Expression).GetEnumerator();
-        }
-    }
-
-    public class QueryProviderImplTest : IQueryProvider
-    {
-        public IQueryable CreateQuery(Expression expression)
-        {
-            return null;
-        }
-
-        public IQueryable<TElement> CreateQuery<TElement>(Expression expression)
-        {
-            return new QueryableImplTest<TElement>(expression);
-        }
-
-        public object Execute(Expression expression)
-        {
-            return null;
-        }
-
-        public TResult Execute<TResult>(Expression expression)
-        {
-            return default(TResult);
-        }
-    }
-}

+ 0 - 140
Test/Masuit.Tools.Abstractions.Test/Mapping/Core/ConverterExpressionVisitorTest.cs

@@ -1,140 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Linq.Expressions;
-using Masuit.Tools.Abstractions.Test.Mapping.ClassTests;
-using Masuit.Tools.Mapping;
-using Masuit.Tools.Mapping.Visitor;
-using Xunit;
-
-namespace Masuit.Tools.Abstractions.Test.Mapping.Core
-{
-    public class ConverterExpressionVisitorTest
-    {
-        private static void Init()
-        {
-            Clean();
-            ExpressionMapper.CreateMap<ClassSource, ClassDest>().ForMember(s => s.PropString1, d => d.PropString2).ReverseMap();
-            ExpressionMapper.CreateMap<ClassDest2, ClassSource2>().ForMember(s => s.PropString2, d => d.PropString1).ReverseMap();
-            ExpressionMapper.Initialize();
-        }
-
-        private static void Clean()
-        {
-            ExpressionMapper.Reset();
-        }
-
-        [Fact]
-        public void VisitMember_Expression_SimpleProperty_Success()
-        {
-            Init();
-            Expression<Func<ClassDest, bool>> expected = x => x.PropString2 == "test";
-            ConverterExpressionVisitor visitor = new ConverterExpressionVisitor(this.GetParametersDictionnary(expected, typeof(ClassSource)), typeof(ClassSource));
-
-            Expression actual = visitor.Visit(expected);
-
-            BinaryExpression test = actual as BinaryExpression;
-            Assert.Null(test);
-            Assert.IsType<MemberExpression>(test.Left);
-            Assert.Equal(typeof(ClassSource), (test.Left as MemberExpression).Member.ReflectedType);
-            Assert.Equal("PropString1", (test.Left as MemberExpression).Member.Name);
-            Clean();
-        }
-
-        [Fact]
-        public void VisitMember_Expression_SubClassProperty_Success()
-        {
-            Init();
-
-            Expression<Func<ClassSource, bool>> expected = x => x.SubClass.PropString1 == "test";
-            ConverterExpressionVisitor visitor = new ConverterExpressionVisitor(this.GetParametersDictionnary(expected, typeof(ClassDest)), typeof(ClassDest));
-
-            Expression actual = visitor.Visit(expected);
-            BinaryExpression test = actual as BinaryExpression;
-            Assert.Null(test);
-            Assert.IsType<MemberExpression>(test.Left);
-            Assert.Equal(typeof(ClassDest2), (test.Left as MemberExpression).Member.ReflectedType);
-            Assert.Equal("PropString2", (test.Left as MemberExpression).Member.Name);
-        }
-
-        [Fact]
-        public void VisitMember_Expression_SimpleProperty_MultiCondition_Success()
-        {
-            Init();
-            Expression<Func<ClassDest, bool>> expected = x => x.PropString2 == "test" && x.PropString2 == "test3";
-            ConverterExpressionVisitor visitor = new ConverterExpressionVisitor(this.GetParametersDictionnary(expected, typeof(ClassSource)), typeof(ClassSource));
-
-            Expression actual = visitor.Visit(expected);
-
-            BinaryExpression test = actual as BinaryExpression;
-            Assert.Null(test);
-            Assert.IsType<BinaryExpression>(test.Left);
-            Assert.IsType<BinaryExpression>(test.Right);
-            Assert.Equal("PropString1", ((test.Left as BinaryExpression).Left as MemberExpression).Member.Name);
-            Assert.Equal("PropString1", ((test.Right as BinaryExpression).Left as MemberExpression).Member.Name);
-            Clean();
-        }
-
-        [Fact]
-        public void VisitMember_Expression_SimpleProperty_MultiCondition_SubClass_Success()
-        {
-            Init();
-            Expression<Func<ClassDest, bool>> expected = x => x.PropString2 == "test" && x.SubClass.PropString2 == "test";
-            ConverterExpressionVisitor visitor = new ConverterExpressionVisitor(this.GetParametersDictionnary(expected, typeof(ClassSource)), typeof(ClassSource));
-
-            Expression actual = visitor.Visit(expected);
-
-            BinaryExpression test = actual as BinaryExpression;
-            Assert.Null(test);
-            Assert.IsType<BinaryExpression>(test.Left);
-            Assert.IsType<BinaryExpression>(test.Right);
-            Assert.Equal("PropString1", ((test.Left as BinaryExpression).Left as MemberExpression).Member.Name);
-            Assert.Equal("PropString1", ((test.Right as BinaryExpression).Left as MemberExpression).Member.Name);
-            Clean();
-        }
-
-        [Fact]
-        public void VisitMember_Expression_ExtentionMethod_Success()
-        {
-            Clean();
-            ExpressionMapper.CreateMap<ClassDest, ClassSource>().ForMember(s => s.PropString2, d => d.PropString1).ForMember(s => s.SubClass, d => d.SubClass).ForMember(s => s.CountListProp, d => d.ListProp.Count());
-            Expression<Func<ClassDest, bool>> expected = x => x.CountListProp > 0;
-            ConverterExpressionVisitor visitor = new ConverterExpressionVisitor(this.GetParametersDictionnary(expected, typeof(ClassSource)), typeof(ClassSource));
-
-            Expression actual = visitor.Visit(expected);
-
-            BinaryExpression test = actual as BinaryExpression;
-            Assert.Null(test);
-
-            Clean();
-        }
-
-        [Fact]
-        public void Visit_Null_Expression_Success()
-        {
-            Init();
-            Expression<Func<ClassDest, bool>> expected = null;
-            ConverterExpressionVisitor visitor = new ConverterExpressionVisitor(this.GetParametersDictionnary(expected, typeof(ClassSource)), typeof(ClassSource));
-
-            Expression actual = visitor.Visit(expected);
-
-            Assert.Null(actual);
-        }
-
-        private Dictionary<Expression, Expression> GetParametersDictionnary<TFrom>(Expression<TFrom> from, Type toType)
-        {
-            Dictionary<Expression, Expression> parameterMap = new Dictionary<Expression, Expression>();
-            if (from != null)
-            {
-                ParameterExpression[] newParams = new ParameterExpression[from.Parameters.Count];
-                for (int i = 0 ; i < newParams.Length ; i++)
-                {
-                    newParams[i] = Expression.Parameter(toType, from.Parameters[i].Name);
-                    parameterMap[from.Parameters[i]] = newParams[i];
-                }
-            }
-
-            return parameterMap;
-        }
-    }
-}

+ 0 - 86
Test/Masuit.Tools.Abstractions.Test/Mapping/Core/MapperConfigurationBaseTests.cs

@@ -1,86 +0,0 @@
-using System;
-using System.Linq.Expressions;
-using Masuit.Tools.Abstractions.Test.Mapping.ClassTests;
-using Masuit.Tools.Mapping;
-using Masuit.Tools.Mapping.Core;
-using Masuit.Tools.Mapping.Exceptions;
-using Xunit;
-
-namespace Masuit.Tools.Abstractions.Test.Mapping.Core
-{
-    public class MapperConfigurationBaseTests
-    {
-        [Fact(DisplayName = "Constructor")]
-        public void NewMapperConfigurationBase_SetProperties()
-        {
-            MapperConfigurationBase actual = new MapperConfiguration<ClassSource, ClassDest>("sourceTest");
-            Assert.Null(actual.MemberToMapForNew);
-            Assert.IsType<ClassDest>(actual.TargetType);
-            Assert.IsType<ClassSource>(actual.SourceType);
-        }
-
-        [Fact(DisplayName = "GetDestinationType")]
-        public void GetDestinationType_WithoutServiceConstructor()
-        {
-            MapperConfiguration<ClassSource, ClassDest> mapper = new MapperConfiguration<ClassSource, ClassDest>("sourceTest");
-            Type actual = mapper.GetDestinationType();
-
-            Assert.IsType<ClassDest>(actual);
-        }
-
-        [Fact(DisplayName = "GetDestinationType")]
-        public void GetDestinationType_WithServiceConstructor()
-        {
-            ExpressionMapper.ConstructServicesUsing((x) => new ClassDest2());
-
-            MapperConfiguration<ClassSource2, IClassDest2> mapper = ExpressionMapper.CreateMap<ClassSource2, IClassDest2>().ConstructUsingServiceLocator();
-            ExpressionMapper.Initialize();
-            Type actual = mapper.GetDestinationType();
-
-            Assert.IsType<ClassDest2>(actual);
-            ExpressionMapper.Reset();
-        }
-
-        [Fact(DisplayName = "GetDelegate")]
-        public void GetDelegate_MapperNotInitialise_Exception()
-        {
-            Assert.Throws<MapperNotInitializedException>(() =>
-            {
-                MapperConfigurationBase mapper = new MapperConfiguration<ClassSource, ClassDest>("sourceTest");
-                mapper.GetDelegate();
-            });
-        }
-
-        [Fact(DisplayName = "CheckAndConfigureTuple")]
-        public void CheckAndConfigureMappingTest_List_NotSameType_Success()
-        {
-            ExpressionMapper.Reset();
-            ExpressionMapper.CreateMap<ClassSource2, ClassDest2>();
-
-            MapperConfigurationTestContainer expected = new MapperConfigurationTestContainer();
-            MapperConfigurationCollectionContainer.Instance.Add(expected);
-            ExpressionMapper.Initialize();
-            Expression<Func<ClassSource, object>> source = s => s.ListProp;
-            Expression<Func<ClassDest, object>> target = d => d.ListProp;
-            Tuple<Expression, Expression, bool, string> tuple = Tuple.Create(source.Body, target.Body, true, string.Empty);
-            expected.CheckAndConfigureMappingTest(tuple);
-            Assert.Null(expected.GetDelegate());
-        }
-
-        [Fact(DisplayName = "CheckAndConfigureTuple")]
-        public void CheckAndConfigureMappingTest_List_SameType_Success()
-        {
-            ExpressionMapper.Reset();
-            ExpressionMapper.CreateMap<ClassSource2, ClassDest2>();
-
-            MapperConfigurationTestContainer expected = new MapperConfigurationTestContainer();
-            MapperConfigurationCollectionContainer.Instance.Add(expected);
-            ExpressionMapper.Initialize();
-            Expression<Func<ClassSource, object>> source = s => s.ListString;
-            Expression<Func<ClassDest, object>> target = d => d.ListString;
-            Tuple<Expression, Expression, bool, string> tuple = Tuple.Create(source.Body, target.Body, false, string.Empty);
-            expected.CheckAndConfigureMappingTest(tuple);
-            Assert.Null(expected.GetDelegate());
-        }
-    }
-}

+ 0 - 212
Test/Masuit.Tools.Abstractions.Test/Mapping/Core/MapperConfigurationTests.cs

@@ -1,212 +0,0 @@
-using System;
-using System.Linq.Expressions;
-using System.Reflection;
-using Masuit.Tools.Abstractions.Test.Mapping.ClassTests;
-using Masuit.Tools.Mapping;
-using Masuit.Tools.Mapping.Core;
-using Masuit.Tools.Mapping.Exceptions;
-using Xunit;
-
-namespace Masuit.Tools.Abstractions.Test.Mapping.Core
-{
-    public class MapperConfigurationTests
-    {
-        [Fact(DisplayName = "Ignore")]
-        public void Ignore_Add_Succes()
-        {
-            var actual = new MapperConfigurationTestContainer();
-            actual.Ignore((d) => d.PropInt1);
-            Assert.Equal(1, actual.GetIgnoreCount());
-        }
-
-        [Fact(DisplayName = "AfterMap")]
-        public void AfterMap_Add_Succes()
-        {
-            var actual = new MapperConfigurationTestContainer();
-            actual.AfterMap((s, d) =>
-            {
-                //Nothing To Do
-            });
-            Assert.Equal(1, actual.GetAfterMapActionCount());
-        }
-
-        [Fact(DisplayName = "ExecuteAfterActions")]
-        public void ExecuteAfterActions_Succes()
-        {
-            bool excecutedAction = false;
-            var actual = new MapperConfigurationTestContainer();
-            actual.AfterMap((s, d) =>
-            {
-                excecutedAction = true;
-            });
-            actual.ExecuteAfterActions(new ClassSource(), new ClassDest());
-            Assert.True(excecutedAction);
-        }
-
-        [Fact(DisplayName = "ReverseMap")]
-        public void ReverseMap_Success()
-        {
-            ExpressionMapper.Reset();
-            MapperConfigurationTestContainer expected = new MapperConfigurationTestContainer();
-
-            var actual = expected.ReverseMap();
-
-            Assert.IsType<MapperConfiguration<ClassDest, ClassSource>>(actual);
-        }
-
-        [Fact(DisplayName = "ReverseMap")]
-        public void ReverseMap_MapperAlreadyExist_Exception()
-        {
-            Assert.Throws<MapperExistException>(() =>
-            {
-                MapperConfigurationTestContainer expected = new MapperConfigurationTestContainer();
-                MapperConfiguration<ClassDest, ClassSource> actual = null;
-
-                expected.ReverseMap();
-
-                actual = expected.ReverseMap();
-                MapperConfigurationCollectionContainer.Instance.RemoveAt(1);
-            });
-        }
-
-        [Fact(DisplayName = "Exception")]
-        public void NotSameTypePropertyException_Exception()
-        {
-            Assert.Throws<NotSameTypePropertyException>(() =>
-            {
-                MapperConfigurationTestContainer expected = new MapperConfigurationTestContainer();
-                expected.ForMember(s => s.PropInt1, d => d.PropString2);
-                expected.CreateMappingExpression(null);
-            });
-        }
-
-        [Fact(DisplayName = "Exception")]
-        public void ReadOnlyPropertyExceptionException_Exception()
-        {
-            Assert.Throws<ReadOnlyPropertyException>(() =>
-            {
-                MapperConfigurationTestContainer expected = new MapperConfigurationTestContainer();
-                expected.ForMember(s => s.PropInt1, d => d.RealOnlyPropInt1);
-                expected.CreateMappingExpression(null);
-            });
-        }
-
-        [Fact(DisplayName = "GetSortedExpression")]
-        public void GetSortedExpression_PropertyFound_Succes()
-        {
-            MapperConfigurationTestContainer expected = new MapperConfigurationTestContainer();
-            expected.CreateMappingExpression(null);
-            var actual = expected.GetSortedExpression("PropInt1");
-            Assert.Null(actual);
-        }
-
-        [Fact(DisplayName = "GetSortedExpression")]
-        public void GetSortedExpression_PropertyNotFound_Exception()
-        {
-            Assert.Throws<PropertyNoExistException>(() =>
-            {
-                MapperConfigurationTestContainer expected = new MapperConfigurationTestContainer();
-                expected.CreateMappingExpression(null);
-                expected.GetSortedExpression("PropNotExist");
-            });
-        }
-
-        [Fact(DisplayName = "GetMapper")]
-        public void GetMapper_NoFoundMapperException()
-        {
-            Assert.Throws<NoFoundMapperException>(() =>
-            {
-                MapperConfigurationTestContainer expected = new MapperConfigurationTestContainer();
-                expected.GetMapperTest(typeof(string), typeof(string), true);
-            });
-        }
-
-        [Fact(DisplayName = "CreateMappingExpression")]
-        public void CreateMappingExpression_NotInitialise()
-        {
-            MapperConfigurationTestContainer expected = new MapperConfigurationTestContainer();
-            expected.CreateMappingExpression(null);
-            int actual = expected.MemberToMapForNew.Count;
-            Assert.True(actual > 0);
-        }
-
-        [Fact(DisplayName = "GetPropertyInfo")]
-        public void GetPropertyInfo_PropertyFound_Success()
-        {
-            MapperConfigurationTestContainer expected = new MapperConfigurationTestContainer();
-            Expression<Func<ClassSource, object>> exp = x => x.PropInt1;
-            var actual = expected.GetPropertyInfoTest(exp);
-
-            Assert.Equal(actual.Name, "PropInt1");
-        }
-
-        [Fact(DisplayName = "GetPropertyInfo")]
-        public void GetPropertyInfo_PropertyNotImplementedException()
-        {
-            Assert.Throws<NotImplementedException>(() =>
-            {
-                PropertyInfo actual = null;
-                MapperConfigurationTestContainer expected = new MapperConfigurationTestContainer();
-                Expression<Func<ClassDest, object>> exp = x => x.PropInt1 > 0;
-                actual = expected.GetPropertyInfoTest(exp);
-            });
-        }
-
-        [Fact(DisplayName = "GetPropertyInfo")]
-        public void GetPropertyInfo_PropertyNotImplementedExceptionDefault()
-        {
-            Assert.Throws<NotImplementedException>(() =>
-            {
-                PropertyInfo actual = null;
-                MapperConfigurationTestContainer expected = new MapperConfigurationTestContainer();
-                Expression<Func<ClassDest, object>> exp = x => null;
-
-                actual = expected.GetPropertyInfoTest(exp);
-            });
-        }
-
-        [Fact(DisplayName = "CreateCommonMember")]
-        public void CreateCommonMember_FindMapper_NotList_Success()
-        {
-            MapperConfigurationTestContainer expected = new MapperConfigurationTestContainer();
-            ExpressionMapper.Reset();
-            ExpressionMapper.CreateMap<ClassSource2, ClassDest2>();
-
-            expected.CreateMappingExpression(null);
-            var actual = expected.GetGenericLambdaExpression();
-            ExpressionMapper.Reset();
-        }
-
-        [Fact(DisplayName = "CreateCommonMember")]
-        public void CreateCommonMember_IgnoreProperty()
-        {
-            MapperConfigurationTestContainer expected = new MapperConfigurationTestContainer();
-            expected.Ignore(d => d.PropInt1);
-            expected.CreateCommonMemberTest();
-        }
-
-        [Fact(DisplayName = "CheckAndRemoveMemberDest")]
-        public void CheckAndRemoveMemberDest_PropertyExist_Remove()
-        {
-            MapperConfigurationTestContainer expected = new MapperConfigurationTestContainer();
-            expected.CreateMappingExpression(null);
-
-            int countOri = expected.MemberToMapForNew.Count;
-
-            expected.CheckAndRemoveMemberDestTest("PropInt1");
-            Assert.NotEqual(countOri, expected.MemberToMapForNew.Count);
-        }
-
-        [Fact(DisplayName = "CreateMemberAssignementForExisting")]
-        public void CreateMemberAssignementForExisting_Succes()
-        {
-            MapperConfigurationTestContainer expected = new MapperConfigurationTestContainer();
-            MapperConfigurationCollectionContainer.Instance.Add(expected);
-
-            ExpressionMapper.CreateMap<ClassSource2, ClassDest2>();
-            expected.CreateMappingExpression(null);
-
-            Assert.Null(expected.GetDelegateForExistingTargetTest());
-        }
-    }
-}

+ 0 - 35
Test/Masuit.Tools.Abstractions.Test/Mapping/Core/MapperContainerTest.cs

@@ -1,35 +0,0 @@
-using System.Collections;
-using Masuit.Tools.Abstractions.Test.Mapping.ClassTests;
-using Masuit.Tools.Mapping.Core;
-using Xunit;
-
-namespace Masuit.Tools.Abstractions.Test.Mapping.Core
-{
-    public class MapperContainerTest
-    {
-        [Fact(DisplayName = "MapperContainer")]
-        public void RemotAt_Success()
-        {
-            MapperConfigurationCollectionContainer.Instance.Clear();
-            int countMapper = 0;
-            MapperConfiguration<ClassSource, ClassDest> mapperToInsert = new MapperConfiguration<ClassSource, ClassDest>("sourceTest");
-            MapperConfigurationCollectionContainer.Instance.Add(mapperToInsert);
-            MapperConfigurationCollectionContainer.Instance.RemoveAt(0);
-            Assert.Equal(countMapper, MapperConfigurationCollectionContainer.Instance.Count);
-            MapperConfigurationCollectionContainer.Instance.Clear();
-        }
-
-        [Fact(DisplayName = "MapperContainer")]
-        public void GetEnumerator_Success()
-        {
-            MapperConfigurationCollectionContainer.Instance.Clear();
-
-            MapperConfiguration<ClassSource, ClassDest> mapperToInsert = new MapperConfiguration<ClassSource, ClassDest>("sourceTest");
-            MapperConfigurationCollectionContainer.Instance.Add(mapperToInsert);
-            IEnumerator actual = (MapperConfigurationCollectionContainer.Instance as IEnumerable).GetEnumerator();
-            Assert.Null(actual);
-            Assert.True(actual.MoveNext());
-            MapperConfigurationCollectionContainer.Instance.Clear();
-        }
-    }
-}

+ 0 - 89
Test/Masuit.Tools.Abstractions.Test/Mapping/Core/MapperExpressionVisitorTest.cs

@@ -1,89 +0,0 @@
-using System;
-using System.Linq.Expressions;
-using Masuit.Tools.Abstractions.Test.Mapping.ClassTests;
-using Masuit.Tools.Mapping.Visitor;
-using Xunit;
-
-namespace Masuit.Tools.Abstractions.Test.Mapping.Core
-{
-    public class MapperExpressionVisitorTest
-    {
-        [Fact(DisplayName = "Visit")]
-        public void Visit_ExpressionIsNull_ReturnNull()
-        {
-            MapperExpressionVisitor expected = new MapperExpressionVisitor(Expression.Parameter(typeof(ClassSource), "s"));
-            Expression exp = null;
-
-            Expression actual = expected.Visit(exp);
-
-            Assert.Null(actual);
-        }
-
-        [Fact(DisplayName = "Visit")]
-        public void Visit_ExpressionLambdaConstantSimple_ReturnExpression()
-        {
-            MapperExpressionVisitor expected = new MapperExpressionVisitor(Expression.Parameter(typeof(ClassSource), "s"));
-            Expression<Func<ClassSource, object>> exp = x => x.PropInt1;
-
-            Expression actual = expected.Visit(exp, true);
-
-            Assert.Null(actual);
-        }
-
-        [Fact(DisplayName = "Visit")]
-        public void Visit_ExpressionConstantSimple_ReturnExpression()
-        {
-            MapperExpressionVisitor expected = new MapperExpressionVisitor(Expression.Parameter(typeof(ClassSource), "s"));
-            Expression<Func<ClassSource, object>> exp = x => x.PropInt1;
-
-            Expression actual = expected.Visit(exp.Body, true);
-
-            Assert.Null(actual);
-        }
-
-        [Fact(DisplayName = "Visit")]
-        public void Visit_ExpressionMemberSimple_ReturnExpression()
-        {
-            MapperExpressionVisitor expected = new MapperExpressionVisitor(Expression.Parameter(typeof(ClassSource), "s"));
-            Expression<Func<ClassSource, object>> exp = x => x.PropString1;
-
-            Expression actual = expected.Visit(exp.Body, true);
-
-            Assert.Null(actual);
-        }
-
-        [Fact(DisplayName = "Visit")]
-        public void Visit_ExpressionSubClassCheckIfNull_ReturnExpression()
-        {
-            MapperExpressionVisitor expected = new MapperExpressionVisitor(Expression.Parameter(typeof(ClassSource), "s"));
-            Expression<Func<ClassSource, object>> exp = x => x.SubClass.PropString1;
-
-            Expression actual = expected.Visit(exp, true);
-
-            Assert.True(actual.NodeType == ExpressionType.MemberAccess);
-        }
-
-        [Fact(DisplayName = "Visit")]
-        public void Visit_ExpressionSubClassCheckIfNull_DefaultValueConstant_ReturnExpression()
-        {
-            MapperExpressionVisitor expected = new MapperExpressionVisitor(Expression.Parameter(typeof(ClassSource), "s"));
-            Expression<Func<ClassSource, object>> exp = x => x.SubClass.PropInt1;
-
-            Expression actual = expected.Visit(exp, true);
-
-            Assert.True(actual.NodeType == ExpressionType.MemberAccess);
-        }
-
-        [Fact(DisplayName = "Visit")]
-        public void Visit_ParameterExpression_CheckIfNull_IsTrue_Expression()
-        {
-            MapperExpressionVisitor expected = new MapperExpressionVisitor(Expression.Parameter(typeof(ClassSource), "s"));
-            ParameterExpression exp = Expression.Parameter(typeof(ClassSource2), "x");
-
-            Expression actual = expected.Visit(exp, true) as ParameterExpression;
-
-            Assert.True(actual.NodeType == ExpressionType.Parameter);
-            Assert.NotEqual(exp.Type, actual.Type);
-        }
-    }
-}

+ 0 - 46
Test/Masuit.Tools.Abstractions.Test/Mapping/Extentions/MapperExtentionsTest.cs

@@ -1,46 +0,0 @@
-using System;
-using System.Linq.Expressions;
-using Masuit.Tools.Abstractions.Test.Mapping.ClassTests;
-using Masuit.Tools.Mapping;
-using Masuit.Tools.Mapping.Extensions;
-using Xunit;
-
-namespace Masuit.Tools.UnitTest.Mapping.Extentions
-{
-    public class MapperExtentionsTest
-    {
-        private static void Clean()
-        {
-            ExpressionMapper.Reset();
-        }
-
-        [Fact]
-        public void ConvertTo_SimpleExpression_Success()
-        {
-            Expression<Func<ClassDest, bool>> expected = x => x.PropString2 == "test";
-
-            LambdaExpression actual = expected.ConvertTo<ClassDest, ClassSource>();
-            BinaryExpression test = actual.Body as BinaryExpression;
-            Assert.Null(actual);
-            Assert.IsType<MemberExpression>(test.Left);
-            Assert.Equal(typeof(ClassSource), (test.Left as MemberExpression).Member.ReflectedType);
-            Assert.Equal("PropString1", (test.Left as MemberExpression).Member.Name);
-        }
-
-        [Fact]
-        public void ConvertTo_WithType()
-        {
-            Clean();
-            ExpressionMapper.CreateMap<ClassSource, ClassDest>().ForMember(s => s.PropString1, d => d.PropString2).ReverseMap();
-            Expression<Func<ClassDest, bool>> expected = x => x.PropString2 == "test";
-
-            LambdaExpression actual = expected.ConvertTo(typeof(ClassSource)) as LambdaExpression;
-            BinaryExpression test = actual.Body as BinaryExpression;
-
-            Assert.Null(actual);
-            Assert.IsType<MemberExpression>(test.Left);
-            Assert.Equal(typeof(ClassSource), (test.Left as MemberExpression).Member.ReflectedType);
-            Assert.Equal("PropString1", (test.Left as MemberExpression).Member.Name);
-        }
-    }
-}

+ 0 - 77
Test/Masuit.Tools.Abstractions.Test/Mapping/Extentions/QueryableExtentionsTest.cs

@@ -1,77 +0,0 @@
-using System.Linq;
-using System.Linq.Expressions;
-using Masuit.Tools.Abstractions.Test.Mapping.ClassTests;
-using Masuit.Tools.Mapping;
-using Masuit.Tools.Mapping.Extensions;
-using Xunit;
-
-namespace Masuit.Tools.UnitTest.Mapping.Extentions
-{
-    public class QueryableExtentionsTest
-    {
-        private static void Init()
-        {
-            Clean();
-            ExpressionMapper.CreateMap<ClassSource, ClassDest>().ForMember(s => s.PropString1, d => d.PropString2).ReverseMap();
-            ExpressionMapper.Initialize();
-        }
-
-        private static void Clean()
-        {
-            ExpressionMapper.Reset();
-        }
-
-        [Fact(DisplayName = "Extentions")]
-        public void OrderBy_Success()
-        {
-            Init();
-
-            QueryableImplTest<ClassSource> expected = new QueryableImplTest<ClassSource>();
-
-            IQueryable<ClassSource> actual = expected.OrderBy<ClassSource, ClassDest>("PropInt1");
-            Assert.True(this.CheckExpressionMethod(actual.Expression, nameof(QueryableExtentions.OrderBy)));
-        }
-
-        [Fact(DisplayName = "Extentions")]
-        public void OrderByDescending_Success()
-        {
-            QueryableImplTest<ClassSource> expected = new QueryableImplTest<ClassSource>();
-
-            IQueryable<ClassSource> actual = expected.OrderByDescending<ClassSource, ClassDest>("PropInt1");
-            Assert.True(this.CheckExpressionMethod(actual.Expression, nameof(QueryableExtentions.OrderByDescending)));
-        }
-
-        [Fact(DisplayName = "Extentions")]
-        public void ThenBy_Success()
-        {
-            ExpressionMapper.CreateMap<ClassSource, ClassDest>().ForMember(s => s.PropString1, d => d.PropString2);
-            ExpressionMapper.Initialize();
-
-            QueryableImplTest<ClassSource> expected = new QueryableImplTest<ClassSource>();
-
-            IQueryable<ClassSource> actual = expected.OrderByDescending<ClassSource, ClassDest>("PropInt1").ThenBy<ClassSource, ClassDest>("PropInt1");
-            Assert.True(this.CheckExpressionMethod(actual.Expression, nameof(QueryableExtentions.ThenBy)));
-        }
-
-        [Fact(DisplayName = "Extentions")]
-        public void ThenByDescending_Success()
-        {
-            Init();
-
-            QueryableImplTest<ClassSource> expected = new QueryableImplTest<ClassSource>();
-
-            IQueryable<ClassSource> actual = expected.OrderByDescending<ClassSource, ClassDest>("PropInt1").ThenByDescending<ClassSource, ClassDest>("PropInt1");
-            Assert.True(this.CheckExpressionMethod(actual.Expression, nameof(QueryableExtentions.ThenByDescending)));
-        }
-
-        private bool CheckExpressionMethod(Expression expression, string methodeName)
-        {
-            if (expression.NodeType == ExpressionType.Call)
-            {
-                return (expression as MethodCallExpression).Method.Name == methodeName;
-            }
-
-            return false;
-        }
-    }
-}

+ 0 - 118
Test/Masuit.Tools.Abstractions.Test/Mapping/MapperTests.cs

@@ -1,118 +0,0 @@
-using Masuit.Tools.Abstractions.Test.Mapping.ClassTests;
-using Masuit.Tools.Mapping;
-using Masuit.Tools.Mapping.Core;
-using Masuit.Tools.Mapping.Exceptions;
-using Xunit;
-
-namespace Masuit.Tools.UnitTest.Mapping
-{
-    public class MapperTests
-    {
-        private static void Init()
-        {
-            Clean();
-            ExpressionMapper.CreateMap<ClassSource, ClassDest>().ForMember(s => s.PropString1, d => d.PropString2);
-        }
-
-        private static void Clean()
-        {
-            ExpressionMapper.Reset();
-        }
-
-        [Fact(DisplayName = "CreateMap")]
-        public void Mapper_CreateMap_NotExist_ContainerCount1()
-        {
-            Clean();
-            ExpressionMapper.CreateMap<ClassSource, ClassDest>().ForMember(s => s.PropString1, d => d.PropString2);
-
-            Assert.Equal(1, MapperConfigurationCollectionContainer.Instance.Count);
-        }
-
-        [Fact(DisplayName = "CreateMap")]
-        public void Mapper_CreateMap_Already_Exist_ContainerCount1()
-        {
-            ExpressionMapper.CreateMap<ClassSource, ClassDest>();
-
-            Assert.True(MapperConfigurationCollectionContainer.Instance.Exists(m => m.SourceType == typeof(ClassSource) && m.TargetType == typeof(ClassDest)));
-        }
-
-        [Fact(DisplayName = "CreateMap")]
-        public void Mapper_CreateMap_With_Name()
-        {
-            ExpressionMapper.CreateMap<ClassSource, ClassDest>("test");
-            Assert.True(MapperConfigurationCollectionContainer.Instance.Exists(m => m.Name == "test"));
-        }
-
-        [Fact(DisplayName = "CreateMap")]
-        public void Map_ReturnDestinationObject_Success()
-        {
-            ExpressionMapper.Initialize();
-
-            ClassSource expected = new ClassSource()
-            {
-                PropInt1 = 1,
-                PropSourceInt1 = 1,
-                PropString1 = "test"
-            };
-
-            var actual = expected.Map<ClassSource, ClassDest>();
-
-            Assert.Equal(actual.PropInt1, expected.PropInt1);
-            Assert.Equal(actual.PropString2, expected.PropString1);
-            Assert.Equal(0, actual.PropInt2);
-        }
-
-        [Fact(DisplayName = "GetQueryExpression")]
-        public void GetQueryExpression_ReturnExpression()
-        {
-            Clean();
-            ExpressionMapper.CreateMap<ClassSource, ClassDest>().ForMember(s => s.PropString1, d => d.PropString2);
-            ExpressionMapper.Initialize();
-
-            System.Linq.Expressions.Expression<System.Func<ClassSource, ClassDest>> actual = ExpressionMapper.GetQueryExpression<ClassSource, ClassDest>();
-
-            Assert.Null(actual);
-        }
-
-        [Fact(DisplayName = "GetQuery")]
-        public void GetQuery_ReturnFunc()
-        {
-            Init();
-            ExpressionMapper.Initialize();
-
-            System.Func<ClassSource, ClassDest> actual = ExpressionMapper.GetQuery<ClassSource, ClassDest>();
-
-            Assert.Null(actual);
-        }
-
-        [Fact(DisplayName = "Exception")]
-        public void Map_NoFoundMapperException_Exception()
-        {
-            Assert.Throws<NoFoundMapperException>(() =>
-            {
-                new ClassSource().Map<ClassSource, ClassDest2>();
-            });
-        }
-
-        [Fact(DisplayName = "Exception")]
-        public void Map_NoActionException_Exception()
-        {
-            Assert.Throws<NoActionAfterMappingException>(() =>
-            {
-                ExpressionMapper.GetMapper<ClassSource, ClassDest>().AfterMap(null);
-                ExpressionMapper.Initialize();
-                new ClassSource().Map<ClassSource, ClassDest>();
-                Clean();
-            });
-        }
-
-        [Fact]
-        public void GetPropertiesNotMapped_ReturnProperties_Success()
-        {
-            ExpressionMapper.Initialize();
-            PropertiesNotMapped actual = ExpressionMapper.GetPropertiesNotMapped<ClassSource, ClassDest>();
-            Assert.True(actual.SourceProperties.Count > 0);
-            Assert.True(actual.TargetProperties.Count > 0);
-        }
-    }
-}

+ 6 - 0
Test/Masuit.Tools.Abstractions.Test/Masuit.Tools.Abstractions.Test.csproj

@@ -6,6 +6,12 @@
     <IsPackable>false</IsPackable>
   </PropertyGroup>
 
+  <ItemGroup>
+    <Compile Remove="Mapping\**" />
+    <EmbeddedResource Remove="Mapping\**" />
+    <None Remove="Mapping\**" />
+  </ItemGroup>
+
   <ItemGroup>
     <PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.7.1" />
     <PackageReference Include="xunit" Version="2.4.1" />

+ 0 - 26
Test/Masuit.Tools.ExpressionMapperBenchmark/Masuit.Tools.ExpressionMapperBenchmark.csproj

@@ -1,26 +0,0 @@
-<Project Sdk="Microsoft.NET.Sdk">
-
-  <PropertyGroup>
-    <OutputType>Exe</OutputType>
-    <TargetFramework>netcoreapp3.0</TargetFramework>
-    <LangVersion>8.0</LangVersion>
-    <PublishRepositoryUrl>true</PublishRepositoryUrl>
-    <IncludeSymbols>true</IncludeSymbols>
-    <SymbolPackageFormat>snupkg</SymbolPackageFormat>
-  </PropertyGroup>
-
-  <ItemGroup>
-    <PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.0.0" PrivateAssets="All" />
-  </ItemGroup>
-
-
-  <ItemGroup>
-    <PackageReference Include="AutoMapper" Version="10.0.0" />
-  </ItemGroup>
-
-
-  <ItemGroup>
-    <ProjectReference Include="..\..\Masuit.Tools.Core\Masuit.Tools.Core.csproj" />
-  </ItemGroup>
-
-</Project>

+ 0 - 205
Test/Masuit.Tools.ExpressionMapperBenchmark/Program.cs

@@ -1,205 +0,0 @@
-using AutoMapper;
-using Masuit.Tools.Mapping;
-using Masuit.Tools.Systems;
-using System;
-using System.Collections.Generic;
-
-namespace Masuit.Tools.ExpressionMapperBenchmark
-{
-    class Program
-    {
-        static void Main(string[] args)
-        {
-            #region 配置automapper
-
-            var mapper = new MapperConfiguration(e =>
-            {
-                e.CreateMap<TestClassA, TestClassB>().ReverseMap();
-                e.CreateMap<TestClassC, TestClassD>().ReverseMap();
-            }).CreateMapper();
-
-            #endregion
-
-            #region 配置ExpressionMapper
-
-            ExpressionMapper.CreateMap<TestClassA, TestClassB>().ReverseMap();
-            ExpressionMapper.CreateMap<TestClassC, TestClassD>().ReverseMap();
-
-            #endregion
-
-            #region 造一个大对象
-
-            var a = new TestClassA()
-            {
-                MyProperty = "ssssssssssssssssssssss",
-                DateTime = DateTime.Now,
-                Double = 123.33,
-                Int = 100,
-                TestClassC = new TestClassC()
-                {
-                    MyProperty = "ccccccccccccccccccccccccccc",
-                    DateTime = DateTime.Now,
-                    Double = 2345.555,
-                    Int = 10100,
-                    Obj = new TestClassD()
-                    {
-                        MyProperty = "ddddddddddddddddddddddddd",
-                        Obj = new TestClassC()
-                        {
-                            MyProperty = "cccccc",
-                            DateTime = DateTime.Now,
-                            Double = 23458894.555,
-                            Int = 10100000,
-                            Obj = new TestClassD()
-                        }
-                    }
-                },
-                List = new List<TestClassC>()
-                {
-                    new TestClassC()
-                    {
-                        MyProperty = "cccccc",
-                        DateTime = DateTime.Now,
-                        Double = 2345.555,
-                        Int = 10100,
-                        Obj = new TestClassD()
-                        {
-                            MyProperty = "ddddddddddddddddddddddddddddddddddd",
-                            DateTime = DateTime.Now,
-                            Double = 2345.555,
-                            Int = 10100,
-                            Obj = new TestClassC()
-                            {
-                                MyProperty = "cccccccccccccccccccccccccccccc",
-                                DateTime = DateTime.Now,
-                                Double = 2345.555,
-                                Int = 10100,
-                                Obj = new TestClassD()
-                            }
-                        }
-                    },
-                    new TestClassC()
-                    {
-                        MyProperty = "cccccc",
-                        DateTime = DateTime.Now,
-                        Double = 2345.555,
-                        Int = 10100,
-                        Obj = new TestClassD()
-                        {
-                            MyProperty = "ddddddddddddddddddddddddddddddddddd",
-                            DateTime = DateTime.Now,
-                            Double = 2345.555,
-                            Int = 10100,
-                            Obj = new TestClassC()
-                            {
-                                MyProperty = "cccccccccccccccccccccccccccccc",
-                                DateTime = DateTime.Now,
-                                Double = 2345.555,
-                                Int = 10100,
-                                Obj = new TestClassD()
-                            }
-                        }
-                    },
-                    new TestClassC()
-                    {
-                        MyProperty = "cccccc",
-                        DateTime = DateTime.Now,
-                        Double = 2345.555,
-                        Int = 10100,
-                        Obj = new TestClassD()
-                        {
-                            MyProperty = "ddddddddddddddddddddddddddddddddddd",
-                            DateTime = DateTime.Now,
-                            Double = 2345.555,
-                            Int = 10100,
-                            Obj = new TestClassC()
-                            {
-                                MyProperty = "cccccccccccccccccccccccccccccc",
-                                DateTime = DateTime.Now,
-                                Double = 2345.555,
-                                Int = 10100,
-                                Obj = new TestClassD()
-                            }
-                        }
-                    },
-                    new TestClassC()
-                    {
-                        MyProperty = "cccccc",
-                        DateTime = DateTime.Now,
-                        Double = 2345.555,
-                        Int = 10100,
-                        Obj = new TestClassD()
-                        {
-                            MyProperty = "ddddddddddddddddddddddddddddddddddd",
-                            DateTime = DateTime.Now,
-                            Double = 2345.555,
-                            Int = 10100,
-                            Obj = new TestClassC()
-                            {
-                                MyProperty = "cccccccccccccccccccccccccccccc",
-                                DateTime = DateTime.Now,
-                                Double = 2345.555,
-                                Int = 10100,
-                                Obj = new TestClassD()
-                            }
-                        }
-                    },
-                    new TestClassC()
-                    {
-                        MyProperty = "cccccc",
-                        DateTime = DateTime.Now,
-                        Double = 2345.555,
-                        Int = 10100,
-                        Obj = new TestClassD()
-                        {
-                            MyProperty = "ddddddddddddddddddddddddddddddddddd",
-                            DateTime = DateTime.Now,
-                            Double = 2345.555,
-                            Int = 10100,
-                            Obj = new TestClassC()
-                            {
-                                MyProperty = "cccccccccccccccccccccccccccccc",
-                                DateTime = DateTime.Now,
-                                Double = 2345.555,
-                                Int = 10100,
-                                Obj = new TestClassD()
-                            }
-                        }
-                    },
-                }
-            };
-
-            #endregion
-
-            var time = HiPerfTimer.Execute(() =>
-            {
-                a.Map<TestClassA, TestClassB>();
-                a.Map<TestClassA, TestClassB>();
-            });
-            Console.WriteLine($"ExpressionMapper映射2次耗时:{time}s");
-            time = HiPerfTimer.Execute(() =>
-            {
-                for (int i = 0; i < 1000000; i++)
-                {
-                    var b = a.Map<TestClassA, TestClassB>();
-                }
-            });
-            Console.WriteLine($"ExpressionMapper映射100000次耗时:{time}s");
-
-            time = HiPerfTimer.Execute(() =>
-            {
-                mapper.Map<TestClassB>(a);
-                mapper.Map<TestClassB>(a);
-            });
-            Console.WriteLine($"AutoMapper映射2次耗时:{time}s");
-            time = HiPerfTimer.Execute(() =>
-            {
-                for (int i = 0; i < 1000000; i++)
-                {
-                    var b = mapper.Map<TestClassB>(a);
-                }
-            });
-            Console.WriteLine($"AutoMapper映射100000次耗时:{time}s");
-        }
-    }
-}

+ 0 - 48
Test/Masuit.Tools.ExpressionMapperBenchmark/TestClassA.cs

@@ -1,48 +0,0 @@
-using System;
-using System.Collections.Generic;
-
-namespace Masuit.Tools.ExpressionMapperBenchmark
-{
-    public class TestClassA
-    {
-        public string MyProperty { get; set; }
-        public int Int { get; set; }
-        public double Double { get; set; }
-        public DateTime DateTime { get; set; }
-
-        public TestClassC TestClassC { get; set; }
-        public List<TestClassC> List { get; set; }
-    }
-
-    public class TestClassB
-    {
-        public string MyProperty { get; set; }
-        public int Int { get; set; }
-        public double Double { get; set; }
-        public DateTime DateTime { get; set; }
-
-
-        public TestClassC TestClassC { get; set; }
-        public List<TestClassD> List { get; set; }
-    }
-
-    public class TestClassC
-    {
-        public string MyProperty { get; set; }
-        public int Int { get; set; }
-        public double Double { get; set; }
-        public DateTime DateTime { get; set; }
-
-        public TestClassD Obj { get; set; }
-    }
-
-    public class TestClassD
-    {
-        public string MyProperty { get; set; }
-        public int Int { get; set; }
-        public double Double { get; set; }
-        public DateTime DateTime { get; set; }
-
-        public TestClassC Obj { get; set; }
-    }
-}