Ejemplo n.º 1
0
        private CodeLocation GetSourceLocationForMethod(string methodName)
        {
            ComDebugSymbolResolver resolver = new ComDebugSymbolResolver(AvoidLocks);

            MethodInfo method = typeof(Sample).GetMethod(methodName, BindingFlags.Instance | BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic);

            return(resolver.GetSourceLocationForMethod(method.DeclaringType.Assembly.Location, method.MetadataToken));
        }
Ejemplo n.º 2
0
        public void GetSourceLocationForMethod_ReturnsUnknownIfAssemblyExistsButThereIsNoPDB()
        {
            CodeLocation codeLocation = new ComDebugSymbolResolver(AvoidLocks).GetSourceLocationForMethod(typeof(ILogger).Assembly.Location, 0);

            Assert.AreEqual(CodeLocation.Unknown, codeLocation);
        }
Ejemplo n.º 3
0
 public void GetSourceLocationForMethod_ReturnsUnknownIfMethodTokenNotValid()
 {
     CodeLocation codeLocation = new ComDebugSymbolResolver(AvoidLocks).GetSourceLocationForMethod(GetType().Assembly.Location, 0);
 }
Ejemplo n.º 4
0
        public void GetSourceLocationForMethod_ReturnsUnknownIfAssemblyFileDoesNotExist()
        {
            CodeLocation codeLocation = new ComDebugSymbolResolver(AvoidLocks).GetSourceLocationForMethod("NoSuchAssembly", 0);

            Assert.AreEqual(CodeLocation.Unknown, codeLocation);
        }