Exemple #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));
        }
Exemple #2
0
        public void GetSourceLocationForMethod_ReturnsUnknownIfAssemblyExistsButThereIsNoPDB()
        {
            CodeLocation codeLocation = new ComDebugSymbolResolver(AvoidLocks).GetSourceLocationForMethod(typeof(ILogger).Assembly.Location, 0);

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

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