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

MatchTypeDefOrRefSignature() private method

private MatchTypeDefOrRefSignature ( ) : void
return void
        public void MatchTypeDefOrRefSignature()
        {
            const string typeNamespace = "SomeNamespace";
            const string typeName = "SomeType";
            var typeRef1 = new TypeReference(CreateAssemblyReference(), typeNamespace, typeName);
            var typeRef2 = new TypeReference(CreateAssemblyReference(), typeNamespace, typeName);
            var typeRef3 = new TypeReference(CreateAssemblyReference(), typeNamespace, typeName + "1");

            var resolutionScope = CreateAssemblyReference();
            resolutionScope.Name += "1";
            var typeRef4 = new TypeReference(resolutionScope, typeNamespace, typeName);

            ITypeDescriptor type1 = new TypeDefOrRefSignature(typeRef1);
            ITypeDescriptor type2 = new TypeDefOrRefSignature(typeRef2);
            ITypeDescriptor type3 = new TypeDefOrRefSignature(typeRef3);
            ITypeDescriptor type4 = new TypeDefOrRefSignature(typeRef4);

            Assert.IsTrue(_comparer.MatchTypes(type1, type2), "The same types did not match each other.");
            Assert.IsFalse(_comparer.MatchTypes(type1, type3), "A name change matched the original.");
            Assert.IsFalse(_comparer.MatchTypes(type1, type4), "A resolution scope change matched the original.");
        }