public void ConstructorWithRefString() { ConstructorInfo constructor = typeof(OutAndRefTestClass).GetConstructors().Single(c => c.GetParameters().Count() == 1); var creator = DynamicReflectionDelegateFactory.Instance.CreateParameterizedConstructor(constructor); object[] args = new object[] { "Input" }; OutAndRefTestClass o = (OutAndRefTestClass)creator(args); Assert.IsNotNull(o); Assert.AreEqual("Input", o.Input); }
public void ConstructorWithRefStringAndOutBool() { ConstructorInfo constructor = TestReflectionUtils.GetConstructors(typeof(OutAndRefTestClass)).Single(c => c.GetParameters().Count() == 2); var creator = LateBoundReflectionDelegateFactory.Instance.CreateParameterizedConstructor(constructor); object[] args = new object[] { "Input", null }; OutAndRefTestClass o = (OutAndRefTestClass)creator(args); Assert.IsNotNull(o); Assert.AreEqual("Input", o.Input); }