public void Test3() { MapperBuilder <NormalSrcFieldModel, NormalDstFieldModel> .Create() .SetPrefix("td_") .Compile(); NormalSrcFieldModel src = new NormalSrcFieldModel(); var dst = LyciumMapper <NormalDstFieldModel> .MapperFrom(src); Assert.Equal(src.ida.ToString(), dst.td_ida); }
public void Test1() { //MapperBuilder<NormalSrcFieldModel,NormalDstFieldModel>. NormalSrcFieldModel src = new NormalSrcFieldModel(); var date = DateTime.Now; src.Date = date.ToString(); var dst = LyciumMapper <NormalDstFieldModel> .MapperFrom(src); Assert.Equal(src.Age, dst.Age); Assert.Equal(date.Year, dst.Date.Year); Assert.Equal(date.Month, dst.Date.Month); Assert.Equal(date.Day, dst.Date.Day); Assert.Equal(date.Hour, dst.Date.Hour); Assert.Equal(date.Minute, dst.Date.Minute); Assert.Equal(date.Second, dst.Date.Second); }
public void Test2() { MapperBuilder <NormalSrcFieldModel, NormalDstFieldModel> .Create() .IgnoreCase() .Compile(); NormalSrcFieldModel src = new NormalSrcFieldModel(); var date = DateTime.Now; src.Date = date.ToString(); var dst = LyciumMapper <NormalDstFieldModel> .MapperFrom(src); Assert.Equal(src.Name, dst.name); Assert.Equal(src.Age, dst.Age); Assert.Equal(date.Year, dst.Date.Year); Assert.Equal(date.Month, dst.Date.Month); Assert.Equal(date.Day, dst.Date.Day); Assert.Equal(date.Hour, dst.Date.Hour); Assert.Equal(date.Minute, dst.Date.Minute); Assert.Equal(date.Second, dst.Date.Second); }