Example #1
0
        public void MethodLoaderConsistency(MethodInfo m)
        {
            var signature = MethodSignature.FromReflection(m);
            var ilSpy     = cx.GetMethod(signature);

            Assert.Equal(SymbolFormatter.MethodToString(m), SymbolFormatter.MethodToString(ilSpy));
            Assert.Equal(signature, SymbolLoader.Method(ilSpy));
        }
Example #2
0
        public void LoadReflectionGenericMethod()
        {
            var ref1        = MethodReference.FromLambda(() => Array.Empty <String>());
            var ilspyMethod = cx.GetMethod(ref1);

            Assert.Equal("System.Array.Empty", ilspyMethod.ReflectionName);
            Assert.Equal("System.String", ilspyMethod.TypeArguments.Single().ReflectionName);
            var ref2 = SymbolLoader.Method(ilspyMethod);

            Assert.Equal(ref1.Signature, ref2);
        }