public void CompatibleNameTest() { var a = new DynamicModel() { Property = "Value" }; Assert.AreEqual("Value", EntityTools<DynamicModel>.GetValue(a, "Prop", false)); EntityTools<DynamicModel>.SetValue(a, "Prop", false, "New"); Assert.AreEqual("New", EntityTools<DynamicModel>.GetValue(a, "Prop", false)); }
public void CopyToTest() { var a = new DataObjectModel() { Name = "Name", NameField = "NameField" }; var b = new DynamicModel(); EntityTools<DataObjectModel, DynamicModel>.CopyTo(a, b); Assert.AreEqual(EntityTools<DataObjectModel>.GetValue(a, "Name", false), EntityTools<DynamicModel>.GetValue(b, "Name", false)); Assert.AreEqual(EntityTools<DataObjectModel>.GetValue(a, "NameField", false), EntityTools<DynamicModel>.GetValue(b, "NameField", false)); }