private static void AssertLineInformation(string methodName, string expected)
        {
            AssemblyDefinition assembly = Db4oToolTestServices.AssemblyFromResource(ResourceName, typeof(DebugInformationTestSuite), DebugInformationTestVariables.TestWithDebugSymbolsAvailable(), SourceHandler);

            MethodDefinition method      = ReflectionServices.FindMethod(assembly, ResourceName, methodName);
            Instruction      instruction = ReflectionServices.FindInstruction(method, OpCodes.Callvirt);

            string actual = DebugInformation.InstructionInformationFor(instruction, method.Body.Instructions);

            string fixedExpectation = FixExpectation(expected);

            Assert.IsTrue(actual.Contains(fixedExpectation), string.Format("Expected: {0}, Actual: {1}", fixedExpectation, actual));
        }
Beispiel #2
0
 protected static AssemblyDefinition GenerateAssembly(string resourceName, params Assembly[] references)
 {
     return(Db4oToolTestServices.AssemblyFromResource(resourceName, typeof(TATestCaseBase), true, delegate { }, references));
 }