AsmResolver.Tests.Net.SignatureComparerTests.MatchMethodDefWithRef C# (CSharp) Method

MatchMethodDefWithRef() private method

private MatchMethodDefWithRef ( ) : void
return void
        public void MatchMethodDefWithRef()
        {
            const string methodName = "MyMethod";

            var assembly = Utilities.CreateTempNetAssembly();
            var tableStream = assembly.NetDirectory.MetadataHeader.GetStream<TableStream>();

            var typeRef = CreateTypeRef1();
            var typeDef = new TypeDefinition(typeRef.Namespace, typeRef.Name);
            tableStream.GetTable<AssemblyDefinition>()[0] = new AssemblyDefinition(typeRef.ResolutionScope.GetAssembly());

            var methodDef = new MethodDefinition(methodName, MethodAttributes.Public, new MethodSignature(CreateTypeSig2()));
            typeDef.Methods.Add(methodDef);

            var match = new MemberReference(typeRef, methodName, new MethodSignature(CreateTypeSig2()));
            var fail1 = new MemberReference(CreateTypeRef3(), methodName, new MethodSignature(CreateTypeSig2()));
            var fail2 = new MemberReference(typeRef, methodName + "1", new MethodSignature(CreateTypeSig2()));
            var fail3 = new MemberReference(typeRef, methodName, new MethodSignature(CreateTypeSig3()));

            VerifyMatching(methodDef, match, fail1, fail2, fail3);
        }