public void ConstructorByDelegateWithType_WithCustomDelegate_NoParams() { var cd = DelegateFactory.Constructor <CustomCtr>(); Assert.IsNotNull(cd); Assert.IsNotNull(cd()); Assert.IsInstanceOfType(cd(), typeof(TestClass)); }
public void ConstructorByDelegateWithType_NoParams() { var c = DelegateFactory.Constructor <Func <TestClass> >(); Assert.IsNotNull(c); Assert.IsNotNull(c()); Assert.IsInstanceOfType(c(), typeof(TestClass)); }
public void ConstructorByDelegateWithType_IntParam_FromStruct() { var c = DelegateFactory.Constructor <Func <int, TestStruct> >(); Assert.IsNotNull(c); var instance = c(0); Assert.IsInstanceOfType(instance, typeof(TestStruct)); }
public void ConstructorByDelegateWithType_BoolParam() { var c = DelegateFactory.Constructor <Func <bool, TestClass> >(); Assert.IsNotNull(c); var instance = c(false); Assert.IsNotNull(instance); Assert.IsInstanceOfType(instance, typeof(TestClass)); }
public void ConstructorByDelegateWithType_WithCustomDelegate_SingleParam() { var cd = DelegateFactory.Constructor <CustomCtrSingleParam>(); Assert.IsNotNull(cd); var instance = cd(0); Assert.IsNotNull(instance); Assert.IsInstanceOfType(instance, typeof(TestClass)); }
public void ConstructorByDelegateWithType_NoCtor_IntParam() { var c = DelegateFactory.Constructor <Func <int, TestClassNoDefaultCtor> >(); Assert.IsNull(c); }
public void ConstructorByDelegateWithType_NoCtor_BoolParam_FromStruct() { var c = DelegateFactory.Constructor <Func <bool, TestStruct> >(); Assert.IsNull(c); }