public void PrivateInstance_InferredName()
            {
                MethodInfo methodInfo = null;

                // Partially generic overload
                methodInfo = MR.GetMethodInfo <PrivateInstance>(typeof(TestClass), false);
                XAssert.NotNull(methodInfo);
            }
            public void PrivateInstance_InferredName()
            {
                PrivateInstance dg       = null;
                TestClass       instance = new TestClass(THE_NAME);

                // Partially generic overload
                dg = MR.GetMethodCaller <PrivateInstance>(instance, typeof(TestClass));
                XAssert.NotNull(dg);
            }
            public void ProtectedStatic_OutParam()
            {
                // Signature with out param should not match signature with ref param
                XAssert.Throws <MissingMethodException>(() => MR.GetMethodInfo <ProtectedStatic_inrefint>(typeof(TestClass), "ProtectedStatic", true));

                var methodInfo = MR.GetMethodInfo <ProtectedStatic_inoutint>(typeof(TestClass), "ProtectedStatic", true);

                XAssert.NotNull(methodInfo);
            }
            public void PrivateStatic_InferredName()
            {
                MethodInfo methodInfo = null;

                // Fully generic overload
                methodInfo = MR.GetMethodInfo <TestClass, PrivateStatic>(true);
                XAssert.NotNull(methodInfo);

                // Partially generic overload
                methodInfo = MR.GetMethodInfo <PrivateStatic>(typeof(TestClass), true);
                XAssert.NotNull(methodInfo);
            }
            public void ProtectedStatic_InferredName()
            {
                ProtectedStatic dg = null;

                // Fully generic overload
                dg = MR.GetMethodCaller <TestClass, ProtectedStatic>();
                XAssert.NotNull(dg);

                // Partially generic overload
                dg = MR.GetMethodCaller <ProtectedStatic>(typeof(TestClass));
                XAssert.NotNull(dg);
            }
            public void ProtectedStatic_OutParam()
            {
                // Signature with out param should not match signature with ref param
                XAssert.Throws <MissingMethodException>(() => MR.GetMethodCaller <ProtectedStatic_inrefint>(typeof(TestClass), "ProtectedStatic"));

                var dg = MR.GetMethodCaller <ProtectedStatic_inoutint>(typeof(TestClass), "ProtectedStatic");

                XAssert.NotNull(dg);

                int val = 0;

                dg(21, out val);
                XAssert.Equal(42, val);
            }
            public void PrivateStatic_InferredName()
            {
                PrivateStatic dg = null;

                // Fully generic overload
                dg = MR.GetMethodCaller <TestClass, PrivateStatic>();
                XAssert.NotNull(dg);
                XAssert.Equal(TestClass.StringConstant, dg());

                // Partially generic overload
                dg = MR.GetMethodCaller <PrivateStatic>(typeof(TestClass));
                XAssert.NotNull(dg);
                XAssert.Equal(TestClass.StringConstant, dg());
            }
            public void PrivateStatic_ExplicitName()
            {
                MethodInfo methodInfo = null;

                // Case-sensitive name
                methodInfo = MR.GetMethodInfo <PrivateStatic_int>(typeof(TestClass), "PrivateStatic", true);
                XAssert.NotNull(methodInfo);

                // Case-sensitive name - should fail
                XAssert.Throws <MissingMethodException>(() => MR.GetMethodInfo <PrivateStatic_int>(typeof(TestClass), "privatestatic", true));

                // Case-insensitive name
                methodInfo = MR.GetMethodInfo <PrivateStatic_int>(typeof(TestClass), "privatestatic", true, true);
                XAssert.NotNull(methodInfo);
            }
            public void ProtectedStatic_ExplicitName()
            {
                ProtectedStatic_string dg = null;

                // Case-sensitive name
                dg = MR.GetMethodCaller <ProtectedStatic_string>(typeof(TestClass), "ProtectedStatic");
                XAssert.NotNull(dg);

                // Case-sensitive name - should fail
                XAssert.Throws <MissingMethodException>(() => MR.GetMethodCaller <ProtectedStatic_string>(typeof(TestClass), "protectedstatic"));

                // Case-insensitive name
                dg = MR.GetMethodCaller <ProtectedStatic_string>(typeof(TestClass), "protectedstatic", true);
                XAssert.NotNull(dg);
            }
            public void ProtectedInstance_ExplicitName()
            {
                MethodInfo methodInfo = null;

                // Case-sensitive name
                methodInfo = MR.GetMethodInfo <ProtectedInstance_int>(typeof(TestClass), "ProtectedInstance", false);
                XAssert.NotNull(methodInfo);

                // Case-sensitive name - should fail
                XAssert.Throws <MissingMethodException>(() => MR.GetMethodInfo <ProtectedInstance_int>(typeof(TestClass), "protectedinstance", false));

                // Case-insensitive name
                methodInfo = MR.GetMethodInfo <ProtectedInstance_int>(typeof(TestClass), "protectedinstance", false, true);
                XAssert.NotNull(methodInfo);
            }
            public void PrivateInstance_ExplicitName()
            {
                PrivateInstance_int dg       = null;
                TestClass           instance = new TestClass(THE_NAME);

                // Case-sensitive name
                dg = MR.GetMethodCaller <PrivateInstance_int>(instance, typeof(TestClass), "PrivateInstance");
                XAssert.NotNull(dg);

                // Case-sensitive name - should fail
                XAssert.Throws <MissingMethodException>(() => MR.GetMethodCaller <PrivateInstance_int>(instance, typeof(TestClass), "privateinstance"));

                // Case-insensitive name
                dg = MR.GetMethodCaller <PrivateInstance_int>(instance, typeof(TestClass), "privateinstance", true);
                XAssert.NotNull(dg);
            }
            public void PrivateStatic_ExplicitName()
            {
                PrivateStatic_int dg      = null;
                string            lConst3 = TestClass.StringConstant + TestClass.StringConstant + TestClass.StringConstant;

                // Case-sensitive name
                dg = MR.GetMethodCaller <PrivateStatic_int>(typeof(TestClass), "PrivateStatic");
                XAssert.NotNull(dg);
                XAssert.Equal(lConst3, dg(3));

                // Case-sensitive name - should fail
                XAssert.Throws <MissingMethodException>(() => MR.GetMethodCaller <PrivateStatic_int>(typeof(TestClass), "privatestatic"));

                // Case-insensitive name
                dg = MR.GetMethodCaller <PrivateStatic_int>(typeof(TestClass), "privatestatic", true);
                XAssert.NotNull(dg);
                XAssert.Equal(lConst3, dg(3));
            }
            public void ProtectedInstance_ExplicitName()
            {
                ProtectedInstance_int dg       = null;
                TestClass             instance = new TestClass(THE_NAME);
                string lExpected = THE_NAME + TestClass.StringConstant + TestClass.StringConstant + TestClass.StringConstant;

                // Case-sensitive name
                dg = MR.GetMethodCaller <ProtectedInstance_int>(instance, typeof(TestClass), "ProtectedInstance");
                XAssert.NotNull(dg);
                XAssert.Equal(lExpected, dg(3));

                // Case-sensitive name - should fail
                XAssert.Throws <MissingMethodException>(() => MR.GetMethodCaller <ProtectedInstance_int>(typeof(TestClass), "protectedinstance"));

                // Case-insensitive name
                dg = MR.GetMethodCaller <ProtectedInstance_int>(instance, typeof(TestClass), "protectedinstance", true);
                XAssert.NotNull(dg);
                XAssert.Equal(lExpected, dg(3));
            }