From 07e8d223bdc1d98e86b9a954ad0b2f00b64f9d9f Mon Sep 17 00:00:00 2001 From: Dustin Campbell Date: Wed, 26 Aug 2015 09:52:38 -0700 Subject: [PATCH] Add a couple more XML doc comment tests on first and last line of buffer --- .../DocumentationCommentTests.cs | 50 +++++++++++++++++++ .../DocumentationCommentTests.vb | 40 +++++++++++++++ 2 files changed, 90 insertions(+) diff --git a/src/EditorFeatures/CSharpTest/DocumentationComments/DocumentationCommentTests.cs b/src/EditorFeatures/CSharpTest/DocumentationComments/DocumentationCommentTests.cs index f7eab157089..c0a08df2993 100644 --- a/src/EditorFeatures/CSharpTest/DocumentationComments/DocumentationCommentTests.cs +++ b/src/EditorFeatures/CSharpTest/DocumentationComments/DocumentationCommentTests.cs @@ -1398,6 +1398,36 @@ void M() VerifyOpenLineAbove(code, expected); } + [WorkItem(2090, "https://github.com/dotnet/roslyn/issues/2090")] + [Fact, Trait(Traits.Feature, Traits.Features.DocumentationComments)] + public void TestOpenLineAbove3() + { + const string code = +@"class C +{ + /// $$ + /// stuff + /// + void M() + { + } +}"; + + const string expected = +@"class C +{ + $$ + /// + /// stuff + /// + void M() + { + } +}"; + + VerifyOpenLineAbove(code, expected); + } + [WorkItem(2090, "https://github.com/dotnet/roslyn/issues/2090")] [Fact, Trait(Traits.Feature, Traits.Features.DocumentationComments)] public void TestOpenLineBelow1() @@ -1458,6 +1488,26 @@ void M() VerifyOpenLineBelow(code, expected); } + [WorkItem(2090, "https://github.com/dotnet/roslyn/issues/2090")] + [Fact, Trait(Traits.Feature, Traits.Features.DocumentationComments)] + public void TestOpenLineBelow3() + { + const string code = +@"/// +/// stuff +/// $$ +"; + + const string expected = +@"/// +/// stuff +/// +/// $$ +"; + + VerifyOpenLineBelow(code, expected); + } + protected override char DocumentationCommentCharacter { get { return '/'; } diff --git a/src/EditorFeatures/VisualBasicTest/DocumentationComments/DocumentationCommentTests.vb b/src/EditorFeatures/VisualBasicTest/DocumentationComments/DocumentationCommentTests.vb index a7daadc7b3b..a07564d7ed2 100644 --- a/src/EditorFeatures/VisualBasicTest/DocumentationComments/DocumentationCommentTests.vb +++ b/src/EditorFeatures/VisualBasicTest/DocumentationComments/DocumentationCommentTests.vb @@ -784,6 +784,31 @@ End Class VerifyOpenLineAbove(code, expected) End Sub + + + Public Sub TestOpenLineAbove3() + Const code = " +Class C + ''' $$ + ''' stuff + ''' + Sub M() + End Sub +End Class +" + Const expected = " +Class C + $$ + ''' + ''' stuff + ''' + Sub M() + End Sub +End Class +" + VerifyOpenLineAbove(code, expected) + End Sub + Public Sub TestOpenLineBelow1() @@ -834,6 +859,21 @@ End Class VerifyOpenLineBelow(code, expected) End Sub + + + Public Sub TestOpenLineBelow3() + Const code = " +''' +''' stuff +''' $$" + Const expected = " +''' +''' stuff +''' +''' $$" + VerifyOpenLineBelow(code, expected) + End Sub + Friend Overrides Function CreateCommandHandler( waitIndicator As IWaitIndicator, undoHistoryRegistry As ITextUndoHistoryRegistry, -- GitLab