Example #1
0
        private CodeLocation GetSourceLocationForMethod(string methodName)
        {
            var        resolver = new CciDebugSymbolResolver();
            MethodInfo method   = typeof(Sample).GetMethod(methodName, BindingFlags.Instance | BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic);

            return(resolver.GetSourceLocationForMethod(method.DeclaringType.Assembly.Location, method.MetadataToken));
        }
Example #2
0
        public void GetSourceLocationForMethod_ReturnsUnknownIfAssemblyExistsButThereIsNoPDB()
        {
            CodeLocation codeLocation = new CciDebugSymbolResolver().GetSourceLocationForMethod(typeof(ILogger).Assembly.Location, 0);

            Assert.AreEqual(CodeLocation.Unknown, codeLocation);
        }
Example #3
0
        public void GetSourceLocationForMethod_ReturnsUnknownIfMethodTokenNotValid()
        {
            CodeLocation codeLocation = new CciDebugSymbolResolver().GetSourceLocationForMethod(GetType().Assembly.Location, 0);

            Assert.AreEqual(CodeLocation.Unknown, codeLocation);
        }
Example #4
0
        public void GetSourceLocationForMethod_ReturnsUnknownIfAssemblyFileDoesNotExist()
        {
            CodeLocation codeLocation = new CciDebugSymbolResolver().GetSourceLocationForMethod("NoSuchAssembly", 0);

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