public void TestToStringProxyCall() { var tAnon = new PropPoco() { Prop1 = "A", Prop2 = 1 }; dynamic tProxy = tAnon.ProxyToString( it => string.Format("{0}:{1}", it.Prop1, it.Prop2)); Assert.AreEqual(tAnon.Prop2, tProxy.Prop2); }
public void TestToStringProxyDictionaryMassage() { var tPropPoco = new PropPoco() { Prop1 = "A" }; dynamic tData = Builder.New().Object(ReturnProp: tPropPoco.ProxyToString(it => "Print Me")); IPropPocoProp tInter = Impromptu.ActLike <IPropPocoProp>(tData); Assert.AreEqual(tPropPoco.GetType(), tInter.ReturnProp.GetType()); }
public void TestToStringProxyConvertImplicit() { var tAnon = new PropPoco() { Prop1 = "A", Prop2 = 1 }; dynamic tProxy = tAnon.ProxyToString( it => string.Format("{0}:{1}", it.Prop1, it.Prop2)); var tAnon2 = ImplicitCast(tProxy); Assert.AreEqual(tAnon.GetType(), tAnon2.GetType()); }