예제 #1
0
        public void String_Type_TypeArray_Module(string name, Type returnType, Type[] parameterTypes)
        {
            Module module = typeof(TestClass).GetTypeInfo().Module;

            DynamicMethod method1 = new DynamicMethod(name, returnType, parameterTypes, module);

            Helpers.VerifyMethod(method1, name, MethodAttributes.Public | MethodAttributes.Static, CallingConventions.Standard, returnType, parameterTypes, module);

            DynamicMethod method2 = new DynamicMethod(name, returnType, parameterTypes, module, true);

            Helpers.VerifyMethod(method2, name, MethodAttributes.Public | MethodAttributes.Static, CallingConventions.Standard, returnType, parameterTypes, module);

            DynamicMethod method3 = new DynamicMethod(name, returnType, parameterTypes, module, false);

            Helpers.VerifyMethod(method3, name, MethodAttributes.Public | MethodAttributes.Static, CallingConventions.Standard, returnType, parameterTypes, module);

            DynamicMethod method4 = new DynamicMethod(name, MethodAttributes.Public | MethodAttributes.Static, CallingConventions.Standard, returnType, parameterTypes, module, true);

            Helpers.VerifyMethod(method4, name, MethodAttributes.Public | MethodAttributes.Static, CallingConventions.Standard, returnType, parameterTypes, module);

            DynamicMethod method5 = new DynamicMethod(name, MethodAttributes.Public | MethodAttributes.Static, CallingConventions.Standard, returnType, parameterTypes, module, false);

            Helpers.VerifyMethod(method5, name, MethodAttributes.Public | MethodAttributes.Static, CallingConventions.Standard, returnType, parameterTypes, module);
        }