예제 #1
0
        private ILImporter ConstructILImporter(TestCase testCase)
        {
            var module   = TestDataLoader.GetModuleForTestAssembly(testCase.ModuleName);
            var method   = (EcmaMethod)module.GetMethod(MetadataTokens.EntityHandle(testCase.MetadataToken));
            var methodIL = EcmaMethodIL.Create(method);

            return(new ILImporter(method, methodIL));
        }
예제 #2
0
        private static IEnumerable <VerificationResult> Verify(TestCase testCase)
        {
            EcmaModule module       = TestDataLoader.GetModuleForTestAssembly(testCase.ModuleName);
            var        methodHandle = (MethodDefinitionHandle)MetadataTokens.EntityHandle(testCase.MetadataToken);
            var        method       = (EcmaMethod)module.GetMethod(methodHandle);
            var        verifier     = new Verifier((ILVerifyTypeSystemContext)method.Context);

            return(verifier.Verify(module.PEReader, methodHandle));
        }