-
Notifications
You must be signed in to change notification settings - Fork 326
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix: DiaSession shows async methods to be external
#307
Changes from 4 commits
bc3630c
b14aefe
be83f1a
f5b6872
0550ae1
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -40,8 +40,44 @@ public void GetNavigationDataShouldReturnCorrectFileNameAndLineNumber() | |
Assert.IsNotNull(diaNavigationData, "Failed to get navigation data"); | ||
StringAssert.EndsWith(diaNavigationData.FileName, @"\SimpleTestProject\UnitTest1.cs"); | ||
|
||
Assert.AreEqual(diaNavigationData.MinLineNumber, 23); | ||
Assert.AreEqual(diaNavigationData.MaxLineNumber, 25); | ||
Assert.AreEqual(23, diaNavigationData.MinLineNumber, "Incorrect min line number"); | ||
Assert.AreEqual(25, diaNavigationData.MaxLineNumber, "Incorrect max line number"); | ||
|
||
this.testEnvironment.TargetFramework = currentTargetFrameWork; | ||
} | ||
|
||
[TestMethod] | ||
public void GetNavigationDataShouldReturnCorrectDataForAsyncMethod() | ||
{ | ||
var currentTargetFrameWork = GetAndSetTargetFrameWork(this.testEnvironment); | ||
var assemblyPath = this.GetAssetFullPath("SimpleTestProject3.dll"); | ||
|
||
DiaSession diaSession = new DiaSession(assemblyPath); | ||
DiaNavigationData diaNavigationData = diaSession.GetNavigationData("SampleUnitTestProject3.UnitTest1+<AsyncTestMethod>d__1", "MoveNext"); | ||
|
||
Assert.IsNotNull(diaNavigationData, "Failed to get navigation data"); | ||
StringAssert.EndsWith(diaNavigationData.FileName, @"\SimpleTestProject3\UnitTest1.cs"); | ||
|
||
Assert.AreEqual(20, diaNavigationData.MinLineNumber, "Incorrect min line number"); | ||
Assert.AreEqual(22, diaNavigationData.MaxLineNumber, "Incorrect max line number"); | ||
|
||
this.testEnvironment.TargetFramework = currentTargetFrameWork; | ||
} | ||
|
||
[TestMethod] | ||
public void GetNavigationDataShouldReturnCorrectDataForOverLoadedMethod() | ||
{ | ||
var currentTargetFrameWork = GetAndSetTargetFrameWork(this.testEnvironment); | ||
var assemblyPath = this.GetAssetFullPath("SimpleTestProject3.dll"); | ||
|
||
DiaSession diaSession = new DiaSession(assemblyPath); | ||
DiaNavigationData diaNavigationData = diaSession.GetNavigationData("SampleUnitTestProject3.Class1", "OverLoadededMethod"); | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Which method's navigation data should it return, there are two methods with the same name? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Currently it is returning the last method in source file for both full and portable pdb. |
||
Assert.IsNotNull(diaNavigationData, "Failed to get navigation data"); | ||
StringAssert.EndsWith(diaNavigationData.FileName, @"\SimpleTestProject3\UnitTest1.cs"); | ||
|
||
Assert.AreEqual(32, diaNavigationData.MinLineNumber, "Incorrect min line number"); | ||
Assert.AreEqual(33, diaNavigationData.MaxLineNumber, "Incorrect max line number"); | ||
|
||
this.testEnvironment.TargetFramework = currentTargetFrameWork; | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do we need this service?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
VS generates this automatically, to identify it as test project. Explanation here.