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

MatchTypeDefWithRef() private method

private MatchTypeDefWithRef ( ) : void
return void
        public void MatchTypeDefWithRef()
        {
            const string typeNamespace = "SomeNamespace";
            const string typeName = "SomeType";

            var assembly = Utilities.CreateTempNetAssembly();
            var tableStream = assembly.NetDirectory.MetadataHeader.GetStream<TableStream>();
            tableStream.GetTable<AssemblyDefinition>()[0] = CreateAssemblyDefinition();

            var typeDef = new TypeDefinition(typeNamespace, typeName);
            tableStream.GetTable<TypeDefinition>().Add(typeDef);

            var type1 = new TypeReference(CreateAssemblyReference(), typeNamespace, typeName);
            var type2 = new TypeReference(CreateAssemblyReference(), typeNamespace, typeName + "1");

            Assert.IsTrue(_comparer.MatchTypes(typeDef, type1));
            Assert.IsTrue(_comparer.MatchTypes(type1, typeDef));
            Assert.IsFalse(_comparer.MatchTypes(typeDef, type2));
            Assert.IsFalse(_comparer.MatchTypes(type2, typeDef));
        }