コード例 #1
0
        public void GetEmittableMethod()
        {
            var method          = ReflectionObjectMother.GetSomeMethod();
            var emittableMethod = ReflectionObjectMother.GetSomeNonGenericMethod();

            CheckGetEmittable(p => p.GetEmittableMethod(method), emittableMethod, emittableMethod.DeclaringType);
        }
コード例 #2
0
        public void Initialization_NoGenericMethodDefinition()
        {
            var method = ReflectionObjectMother.GetSomeNonGenericMethod();

            Assert.That(
                () => Dev.Null = new MethodInstantiationInfo(method, Type.EmptyTypes),
                Throws.ArgumentException
                .With.ArgumentExceptionMessageEqualTo("Specified method must be a generic method definition.", "genericMethodDefinition"));
        }
コード例 #3
0
        public void IsGenericMethodInstantiation()
        {
            var nonGenericMethod        = ReflectionObjectMother.GetSomeNonGenericMethod();
            var genericMethodDefinition = NormalizingMemberInfoFromExpressionUtility.GetGenericMethodDefinition(() => Method <Dev.T, Dev.T>());
            var methodInstantiation     = NormalizingMemberInfoFromExpressionUtility.GetMethod(() => Method <int, string>());

            Assert.That(nonGenericMethod.IsGenericMethodInstantiation(), Is.False);
            Assert.That(genericMethodDefinition.IsGenericMethodInstantiation(), Is.False);
            Assert.That(methodInstantiation.IsGenericMethodInstantiation(), Is.True);
        }
コード例 #4
0
        public void Initialization_NoGenericMethodDefinition()
        {
            var method = ReflectionObjectMother.GetSomeNonGenericMethod();

            Dev.Null = new MethodInstantiationInfo(method, Type.EmptyTypes);
        }