public void GetMethodInfo_Action_InvalidThrowIfNotFoundThrows() { Expression <Action> exp = () => new InfoHelperClass(); MethodInfo info = InfoHelper.GetMethodInfo(exp, true); Assert.Fail("Didn't throw"); }
public void GetMethodInfo_FuncInstance_InvalidThrowIfNotFoundThrows() { Expression <Func <InfoHelperClass, object> > exp = i => new InfoHelperClass(); MethodInfo info = InfoHelper.GetMethodInfo(exp, true); Assert.Fail("Didn't throw"); }
public void GetMethodInfo_Action_Invalid() { Expression <Action> exp = () => new InfoHelperClass(); MethodInfo info = InfoHelper.GetMethodInfo(exp); Assert.IsNull(info); }
public void GetMethodInfo_Action_NoArgs() { MethodInfo info = InfoHelper.GetMethodInfo(() => InfoHelperClass.StaticVoidMethod()); Assert.IsNotNull(info); Assert.AreEqual(info.Name, "StaticVoidMethod"); }
public void GetMethodInfo_FuncInstance_Int() { MethodInfo info = InfoHelper.GetMethodInfo <InfoHelperClass>(i => i.IntMethod()); Assert.IsNotNull(info); Assert.AreEqual(info.Name, "IntMethod"); }
public void GetMethodInfo_FuncInstance_Invalid() { Expression <Func <InfoHelperClass, object> > exp = i => new InfoHelperClass(); MethodInfo info = InfoHelper.GetMethodInfo(exp); Assert.IsNull(info); }
public void GetMethodInfo_Func_Int() { MethodInfo info = InfoHelper.GetMethodInfo(() => InfoHelperClass.StaticIntMethod()); Assert.IsNotNull(info); Assert.AreEqual(info.Name, "StaticIntMethod"); }
public void GetMethodInfo_ActionInstance_NoArgs() { MethodInfo info = InfoHelper.GetMethodInfo <InfoHelperClass>(i => i.VoidMethod()); Assert.IsNotNull(info); Assert.AreEqual(info.Name, "VoidMethod"); }
public void GetMethodInfo_Action_OutArgsHelper() { MethodInfo info = InfoHelper.GetMethodInfo( () => InfoHelperClass.StaticOutMethod(ref InfoHelper <int> .RefOrOut, out InfoHelper <int> .RefOrOut)); Assert.IsNotNull(info); Assert.AreEqual(info.Name, "StaticOutMethod"); }
public void GetMethodInfo_Action_OutArgs() { int a = 0, b; MethodInfo info = InfoHelper.GetMethodInfo(() => InfoHelperClass.StaticOutMethod(ref a, out b)); Assert.IsNotNull(info); Assert.AreEqual(info.Name, "StaticOutMethod"); }
public void GetMethodInfo_Action_Args() { MethodInfo info = InfoHelper.GetMethodInfo( () => InfoHelperClass.StaticVoidArgsMethod(default(string), default(int))); Assert.IsNotNull(info); Assert.AreEqual(info.Name, "StaticVoidArgsMethod"); }
public void GetMethodInfo_ActionInstance_OutArgsHelper() { MethodInfo info = InfoHelper.GetMethodInfo <InfoHelperClass>( i => i.OutMethod(ref InfoHelper <int> .RefOrOut, out InfoHelper <int> .RefOrOut)); Assert.IsNotNull(info); Assert.AreEqual(info.Name, "OutMethod"); }
public void GetMethodInfo_ActionInstance_OutArgs() { int a = 0, b; MethodInfo info = InfoHelper.GetMethodInfo <InfoHelperClass>(i => i.OutMethod(ref a, out b)); Assert.IsNotNull(info); Assert.AreEqual(info.Name, "OutMethod"); }
public void GetMethodInfo_ActionInstance_Args() { MethodInfo info = InfoHelper.GetMethodInfo <InfoHelperClass>( i => i.VoidArgsMethod(default(string), default(int))); Assert.IsNotNull(info); Assert.AreEqual(info.Name, "VoidArgsMethod"); }