diff --git a/src/EditorFeatures/Test2/Rename/InlineRenameTests.vb b/src/EditorFeatures/Test2/Rename/InlineRenameTests.vb index 665f16ff789d613e498aa934d1a11506577935a6..3c50c5395eac76f04fe932b94cb4daf103ab0e8f 100644 --- a/src/EditorFeatures/Test2/Rename/InlineRenameTests.vb +++ b/src/EditorFeatures/Test2/Rename/InlineRenameTests.vb @@ -2008,5 +2008,95 @@ class [|C|] VerifyFileName(workspace, "Test1") End Using End Function + + + + Public Async Function RenameRecordWithNoBody1(host As RenameTestHost) As Task + Using workspace = CreateWorkspaceWithWaiter( + + + + record [|$$Goo|](int a); + class C + { + [|Goo|] g; + } + + + , host) + + Dim session = StartSession(workspace) + + ' Type a bit in the file + Dim caretPosition = workspace.Documents.Single(Function(d) d.CursorPosition.HasValue).CursorPosition.Value + Dim textBuffer = workspace.Documents.Single().GetTextBuffer() + + textBuffer.Insert(caretPosition, "Bar") + + session.Commit() + + Await VerifyTagsAreCorrect(workspace, "BarGoo") + End Using + End Function + + + + Public Async Function RenameRecordWithBody(host As RenameTestHost) As Task + Using workspace = CreateWorkspaceWithWaiter( + + + + record [|$$Goo|](int a) { } + class C + { + [|Goo|] g; + } + + + , host) + + Dim session = StartSession(workspace) + + ' Type a bit in the file + Dim caretPosition = workspace.Documents.Single(Function(d) d.CursorPosition.HasValue).CursorPosition.Value + Dim textBuffer = workspace.Documents.Single().GetTextBuffer() + + textBuffer.Insert(caretPosition, "Bar") + + session.Commit() + + Await VerifyTagsAreCorrect(workspace, "BarGoo") + End Using + End Function + + + + Public Async Function RenameRecordConstructorCalled(host As RenameTestHost) As Task + Using workspace = CreateWorkspaceWithWaiter( + + + + record [|$$Goo|](int a) { } + class C + { + [|Goo|] g = new [|Goo|](1); + } + + + , host) + + Dim session = StartSession(workspace) + + ' Type a bit in the file + Dim caretPosition = workspace.Documents.Single(Function(d) d.CursorPosition.HasValue).CursorPosition.Value + Dim textBuffer = workspace.Documents.Single().GetTextBuffer() + + textBuffer.Insert(caretPosition, "Bar") + + session.Commit() + + Await VerifyTagsAreCorrect(workspace, "BarGoo") + End Using + End Function End Class End Namespace