从山证v2.3.0拷贝

This commit is contained in:
吴方海
2024-05-09 14:06:26 +08:00
parent 566ff33259
commit f9d8a256a6
4471 changed files with 1203456 additions and 9 deletions
@@ -0,0 +1,30 @@
using AutoMapper;
namespace YLErp.Basic
{
[TestClass]
public class AutoMapperTest
{
[TestMethod]
public void TestDictionToObject()
{
var dic = new Dictionary<string, object> {
{"AA","11" },
{"BB","22" }
};
var poco = new Mapper(new MapperConfiguration(cfg => { })).Map<TestPoco>(dic);
Assert.IsTrue(poco.AA == "11" && poco.BB == "22");
dic = new Dictionary<string, object> {
{"AA","33" },
{"BB","44" }
};
new Mapper(new MapperConfiguration(cfg => { })).Map(dic, poco);
Assert.IsTrue(poco.AA == "33" && poco.BB == "44");
}
}
}