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)); }
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)); }