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

add regression test for WithDocumentationMode #17803

Merged
merged 3 commits into from
Mar 15, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,17 @@ private void TestProperty<T>(Func<CSharpParseOptions, T, CSharpParseOptions> fac
Assert.Same(newOpt2, newOpt1);
}

[Fact]
[WorkItem(15358, "https://github.com/dotnet/roslyn/issues/15358")]
public void WithDocumentationModeDoesntChangeFeatures()
{
var kvp = new KeyValuePair<string, string>("IOperation", "true");
var po = new CSharpParseOptions().WithFeatures(new[] { kvp });
Assert.Equal(po.Features.AsSingleton(), kvp);
var po2 = po.WithDocumentationMode(DocumentationMode.Diagnose);
Copy link
Contributor

@AlekseyTs AlekseyTs Mar 14, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

var po2 = po.WithDocumentationMode(DocumentationMode.Diagnose); [](start = 12, length = 63)

I think it would be good to assert DocumentationMode before and after. What if the WithDocumentationMode method does nothing? #Closed

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is tested in the next test in the file.

Assert.Equal(po2.Features.AsSingleton(), kvp);
}

[Fact]
public void WithXxx()
{
Expand Down