Beispiel #1
0
        public void GetEmittableMethod()
        {
            var method          = ReflectionObjectMother.GetSomeMethod();
            var emittableMethod = ReflectionObjectMother.GetSomeNonGenericMethod();

            CheckGetEmittable(p => p.GetEmittableMethod(method), emittableMethod, emittableMethod.DeclaringType);
        }
        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"));
        }
Beispiel #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);
        }
        public void Initialization_NoGenericMethodDefinition()
        {
            var method = ReflectionObjectMother.GetSomeNonGenericMethod();

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