Skip to content
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

Unit testing support for <include> documentation elements #6315

Closed
sharwell opened this issue Oct 26, 2015 · 4 comments
Closed

Unit testing support for <include> documentation elements #6315

sharwell opened this issue Oct 26, 2015 · 4 comments

Comments

@sharwell
Copy link
Member

I'm having trouble writing a unit test that includes a documentation comment containing an <include> element. I tried using AddAdditionalDocument to add the included file to the workspace, and I also tried writing the file to disk. In both cases, the expanded documentation simply included a comment saying the <include> element could not be expanded. See sharwell/StyleCopAnalyzers@93749a8 for an example.

❓ Does the AdhocWorkspace support resolving <include> elements in a documentation comment? If so, where do I place the included file such that it will be located?

📝 This is part of my work to resolve DotNetAnalyzers/StyleCopAnalyzers#1603.

@gafter gafter added this to the 1.2 milestone Oct 28, 2015
@gafter gafter added the Test Test failures in roslyn-CI label Oct 28, 2015
@jaredpar jaredpar added Question and removed Test Test failures in roslyn-CI labels Nov 30, 2015
@jaredpar jaredpar modified the milestones: Unknown, 1.2 Nov 30, 2015
@jaredpar
Copy link
Member

jaredpar commented Dec 3, 2015

CC @jasonmalinowski as he knows AdhockWorkspace the best.

@daveaglick
Copy link
Contributor

If it helps, I was having this same problem and resolved it by supplying an XmlReferenceResolver to the compilation options. Failure to supply one results in the described behavior.

@jasonmalinowski
Copy link
Member

I believe @daveaglick's advice is correct: the compiler/workspace tries to abstract files, and so unless there's a resolver doing something the compiler just will skip them.

@sharwell
Copy link
Member Author

sharwell commented Dec 4, 2015

We successfully implemented unit tests for this functionality in DotNetAnalyzers/StyleCopAnalyzers#1898, based on @daveaglick's suggestions.

@sharwell sharwell closed this as completed Dec 4, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants