-
Notifications
You must be signed in to change notification settings - Fork 22
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
Added test project and moved to Microsoft.CodeAnalysis v1.0.0 #67
Conversation
We need to do this in order to use Roslyn's test framework. We also needed to add a reference to MEF 2 (Microsoft.Composition) which isn't yet distributed via .NET.
We don't need to be signing these things as we're not working with anyone else's internals.
var document = solution.Projects.SelectMany(n => n.Documents).Where(n => n.Name == "Document1.cs").Single(); | ||
var linkProvider = new ReferencesourceLinkProvider(); | ||
|
||
var walker = new SourceBrowser.Generator.DocumentWalkers.CSWalker(fm, document, linkProvider); |
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.
var walker = SourceBrowser.Generator.DocumentWalkers.WalkerSelector.GetWalker(fm, document, linkProvider);
Also, make SourceBrowser.Generator.DocumentWalkers.WalkerSelector a public class
Apply this change to other tests
MSBuildWorkspaceTestClass looks really handy. Good job! 😄 I tried integrating this with Marcin's PR #70 but the checked out pull request branches are read only (which means that only he can adapt his code to this merge). Is it ok if we merge #70 first? Then we need to do the following:
|
You can add |
Yeah, we'll just use InternalsVisibleTo and make WalkerSelector internal instead of private. |
This will fix #11 and from now on we should be adding tests when fixing generator bugs such as #17 and #64.
I've used Kirill Osenkov's
MSBuildWorkspaceTestBase
class. You can see how they're using it internally here: http://source.roslyn.codeplex.com/#Roslyn.Services.UnitTests/WorkspaceTests/MSBuildWorkspaceTests.cs,148It seems like a nice approach to quickly and easily create solutions without having to write a ton of boilerplate code.
This new version of Microsoft.CodeAnalysis depends on MEF 2 which is the
Microsoft.Composition
package on NuGet.I still have to write tests for parameters and locals and will do so after #66 is merged.