예제 #1
0
        public void GetMethodInfo_Action_InvalidThrowIfNotFoundThrows()
        {
            Expression <Action> exp  = () => new InfoHelperClass();
            MethodInfo          info = InfoHelper.GetMethodInfo(exp, true);

            Assert.Fail("Didn't throw");
        }
예제 #2
0
        public void GetMethodInfo_FuncInstance_InvalidThrowIfNotFoundThrows()
        {
            Expression <Func <InfoHelperClass, object> > exp = i => new InfoHelperClass();
            MethodInfo info = InfoHelper.GetMethodInfo(exp, true);

            Assert.Fail("Didn't throw");
        }
예제 #3
0
        public void GetMethodInfo_Action_Invalid()
        {
            Expression <Action> exp  = () => new InfoHelperClass();
            MethodInfo          info = InfoHelper.GetMethodInfo(exp);

            Assert.IsNull(info);
        }
예제 #4
0
        public void GetMethodInfo_Action_NoArgs()
        {
            MethodInfo info = InfoHelper.GetMethodInfo(() => InfoHelperClass.StaticVoidMethod());

            Assert.IsNotNull(info);
            Assert.AreEqual(info.Name, "StaticVoidMethod");
        }
예제 #5
0
        public void GetMethodInfo_FuncInstance_Int()
        {
            MethodInfo info = InfoHelper.GetMethodInfo <InfoHelperClass>(i => i.IntMethod());

            Assert.IsNotNull(info);
            Assert.AreEqual(info.Name, "IntMethod");
        }
예제 #6
0
        public void GetMethodInfo_FuncInstance_Invalid()
        {
            Expression <Func <InfoHelperClass, object> > exp = i => new InfoHelperClass();
            MethodInfo info = InfoHelper.GetMethodInfo(exp);

            Assert.IsNull(info);
        }
예제 #7
0
        public void GetMethodInfo_Func_Int()
        {
            MethodInfo info = InfoHelper.GetMethodInfo(() => InfoHelperClass.StaticIntMethod());

            Assert.IsNotNull(info);
            Assert.AreEqual(info.Name, "StaticIntMethod");
        }
예제 #8
0
        public void GetMethodInfo_ActionInstance_NoArgs()
        {
            MethodInfo info = InfoHelper.GetMethodInfo <InfoHelperClass>(i => i.VoidMethod());

            Assert.IsNotNull(info);
            Assert.AreEqual(info.Name, "VoidMethod");
        }
예제 #9
0
        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");
        }
예제 #10
0
        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");
        }
예제 #11
0
        public void GetMethodInfo_Action_Args()
        {
            MethodInfo info = InfoHelper.GetMethodInfo(
                () => InfoHelperClass.StaticVoidArgsMethod(default(string), default(int)));

            Assert.IsNotNull(info);
            Assert.AreEqual(info.Name, "StaticVoidArgsMethod");
        }
예제 #12
0
        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");
        }
예제 #13
0
        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");
        }
예제 #14
0
        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");
        }