public void DeveConverterObjetoAnonimoParaConcreto() { var expectd = new ClsTest { Name = "Test" }; var actual = new JObject { { "Name", "Test" } }.ToAnonymousType(new ClsTest()); Assert.Equal(expectd, actual, new ClsTestComparer()); }
public void DeveConverterObjetoComDataOutroFormatoAnonimoParaConcreto() { var date = new DateTime(2020, 1, 1); var expectd = new ClsTest { Name = "Test", Date = date }; var actual = new JObject { { "Name", "Test" }, { "Date", date.ToString(DATE_FORMAT) } }.ToAnonymousType(new ClsTest(), GetTradingDaySerializer()); Assert.Equal(expectd, actual, new ClsTestComparer()); }