Beispiel #1
0
        protected override void HandleRefOutMethod(MethodInfo baseMethod, MethodInformation methodDescription)
        {
            var returnType = baseMethod.ReturnType;

            this.generatedDelegates.Add(MethodTemplates.GetAssemblyDelegate(
                                            baseMethod.ReturnType == typeof(void) ? "void" : TypeDissector.Create(returnType).SafeName,
                                            methodDescription.DelegateCast,
                                            baseMethod.GetParameters(this.Namespaces), baseMethod.IsUnsafeToMock()));
            this.Namespaces.Add(returnType.Namespace);
        }
Beispiel #2
0
 public static void GetAssemblyDelegateTemplateWhenIsUnsafeIsTrue() =>
 Assert.That(MethodTemplates.GetAssemblyDelegate("a", "b", "c", true),
             Is.EqualTo("public unsafe delegate a b(c);"));