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);
 }
 public void GetSourceLocationForMethod_ReturnsUnknownIfAssemblyExistsButThereIsNoPDB()
 {
     CodeLocation codeLocation = new CciDebugSymbolResolver().GetSourceLocationForMethod(typeof(ILogger).Assembly.Location, 0);
     Assert.AreEqual(CodeLocation.Unknown, codeLocation);
 }
 public void GetSourceLocationForMethod_ReturnsUnknownIfMethodTokenNotValid()
 {
     CodeLocation codeLocation = new CciDebugSymbolResolver().GetSourceLocationForMethod(GetType().Assembly.Location, 0);
     Assert.AreEqual(CodeLocation.Unknown, codeLocation);
 }
 public void GetSourceLocationForMethod_ReturnsUnknownIfAssemblyFileDoesNotExist()
 {
     CodeLocation codeLocation = new CciDebugSymbolResolver().GetSourceLocationForMethod("NoSuchAssembly", 0);
     Assert.AreEqual(CodeLocation.Unknown, codeLocation);
 }