Example #1
0
        public void SelectStaticParameterLessWithReturnValueReturnsCorrectMethod()
        {
            MethodInfo actual = Methods.Select(() => ClassWithStaticMethods.StaticOmitParametersWithReturnValue());

            var expected = typeof(ClassWithStaticMethods).GetMethod("StaticOmitParametersWithReturnValue");

            Assert.Equal(expected, actual);
        }
Example #2
0
        public void SelectStaticParameterLessGenericMethodReturnsCorrectMethod()
        {
            MethodInfo actual = Methods.Select(() => ClassWithStaticMethods.StaticOmitParametersGeneric <T>());

            var expected =
                typeof(ClassWithStaticMethods)
                .GetMethod("StaticOmitParametersGeneric")
                .MakeGenericMethod(typeof(T));

            Assert.Equal(expected, actual);
        }
Example #3
0
        public void SelectStaticNonParameterLessGenericMethodReturnsCorrectMethod()
        {
            var dummy = default(T);

            MethodInfo actual = Methods.Select(() => ClassWithStaticMethods.IncludeParameters <T>(dummy));

            var expected =
                typeof(ClassWithStaticMethods)
                .GetMethod("IncludeParameters")
                .MakeGenericMethod(typeof(T));

            Assert.Equal(expected, actual);
        }