本文整理汇总了C#中Microsoft.CodeAnalysis.Editor.UnitTests.RenameTracking.RenameTrackingTestState类的典型用法代码示例。如果您正苦于以下问题:C# RenameTrackingTestState类的具体用法?C# RenameTrackingTestState怎么用?C# RenameTrackingTestState使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
RenameTrackingTestState类属于Microsoft.CodeAnalysis.Editor.UnitTests.RenameTracking命名空间,在下文中一共展示了RenameTrackingTestState类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: RenameTrackingNotInBlankFile
public void RenameTrackingNotInBlankFile()
{
var code = @"$$";
using (var state = new RenameTrackingTestState(code, LanguageNames.CSharp))
{
state.EditorOperations.InsertText("d");
state.AssertNoTag();
}
}
示例2: RenameTrackingNotInBlankFile
public async Task RenameTrackingNotInBlankFile()
{
var code = @"$$";
using (var state = new RenameTrackingTestState(code, LanguageNames.CSharp))
{
state.EditorOperations.InsertText("d");
await state.AssertNoTag().ConfigureAwait(true);
}
}
示例3: RenameTrackingNotOnCreation
public void RenameTrackingNotOnCreation()
{
var code = @"
class C$$
{
}";
using (var state = new RenameTrackingTestState(code, LanguageNames.CSharp))
{
state.AssertNoTag();
}
}
示例4: RenameTrackingNotOnCreation
public async Task RenameTrackingNotOnCreation()
{
var code = @"
class C$$
{
}";
using (var state = new RenameTrackingTestState(code, LanguageNames.CSharp))
{
await state.AssertNoTag().ConfigureAwait(true);
}
}
示例5: RenameTrackingTypingInMiddle
public async Task RenameTrackingTypingInMiddle()
{
var code = @"
class AB$$CD
{
}";
using (var state = new RenameTrackingTestState(code, LanguageNames.CSharp))
{
state.EditorOperations.InsertText("ZZ");
await state.AssertTag("ABCD", "ABZZCD").ConfigureAwait(true);
}
}
示例6: RenameTrackingTypingAtBeginning
public async Task RenameTrackingTypingAtBeginning()
{
var code = @"
class $$C
{
}";
using (var state = new RenameTrackingTestState(code, LanguageNames.CSharp))
{
state.EditorOperations.InsertText("AB");
await state.AssertTag("C", "ABC").ConfigureAwait(true);
}
}
示例7: RenameTrackingTypingAtBeginning
public void RenameTrackingTypingAtBeginning()
{
var code = @"
class $$C
{
}";
using (var state = new RenameTrackingTestState(code, LanguageNames.CSharp))
{
state.EditorOperations.InsertText("AB");
state.AssertTag("C", "ABC");
}
}
示例8: RenameTrackingTypingInMiddle
public void RenameTrackingTypingInMiddle()
{
var code = @"
class AB$$CD
{
}";
using (var state = new RenameTrackingTestState(code, LanguageNames.CSharp))
{
state.EditorOperations.InsertText("ZZ");
state.AssertTag("ABCD", "ABZZCD");
}
}
示例9: RenameTrackingTypingAtEnd
public void RenameTrackingTypingAtEnd()
{
var code = @"
class C$$
{
}";
using (var state = new RenameTrackingTestState(code, LanguageNames.CSharp))
{
state.EditorOperations.InsertText("at");
state.AssertTag("C", "Cat");
}
}
示例10: RenameTrackingNotWhenStartedFromTextualWordInTrivia
public void RenameTrackingNotWhenStartedFromTextualWordInTrivia()
{
var code = @"
Module Program
Sub Main()
Dim [x$$ = 1
End Sub
End Module";
using (var state = new RenameTrackingTestState(code, LanguageNames.VisualBasic))
{
state.EditorOperations.InsertText("]");
state.AssertNoTag();
}
}
示例11: RenameTrackingAlertsAboutThirdPartyRequestsForCancellationAfterRename
public void RenameTrackingAlertsAboutThirdPartyRequestsForCancellationAfterRename()
{
var code = @"
class Cat$$
{
public Cat()
{
}
}";
using (var state = new RenameTrackingTestState(code, LanguageNames.CSharp, onAfterGlobalSymbolRenamedReturnValue: false))
{
state.EditorOperations.InsertText("s");
state.AssertTag("Cat", "Cats", invokeAction: true);
Assert.Equal(1, state.RefactorNotifyService.OnBeforeSymbolRenamedCount);
Assert.Equal(1, state.RefactorNotifyService.OnAfterSymbolRenamedCount);
state.AssertNotificationMessage();
// Make sure the rename completed
var expectedCode = @"
class Cats
{
public Cats()
{
}
}";
Assert.Equal(expectedCode, state.HostDocument.TextBuffer.CurrentSnapshot.GetText());
state.AssertNoTag();
}
}
示例12: RenameTrackingDeleteFromEnd
public void RenameTrackingDeleteFromEnd()
{
var code = @"
class ABC$$
{
}";
using (var state = new RenameTrackingTestState(code, LanguageNames.CSharp))
{
state.EditorOperations.Backspace();
state.AssertTag("ABC", "AB");
}
}
示例13: CancelRenameTracking
public void CancelRenameTracking()
{
var code = @"
class C$$
{
}";
using (var state = new RenameTrackingTestState(code, LanguageNames.CSharp))
{
state.EditorOperations.InsertText("at");
state.AssertTag("C", "Cat");
state.SendEscape();
state.AssertNoTag();
}
}
示例14: RenameTrackingUndoTwiceRedoTwiceUndoStillWorks
public void RenameTrackingUndoTwiceRedoTwiceUndoStillWorks()
{
var code = @"
class Cat$$
{
}";
using (var state = new RenameTrackingTestState(code, LanguageNames.CSharp))
{
state.EditorOperations.InsertText("s");
state.AssertTag("Cat", "Cats", invokeAction: true);
state.AssertNoTag();
// Resume rename tracking session
state.Undo(2);
state.AssertTag("Cat", "Cats");
state.Redo(2);
state.AssertNoTag();
// Back to original
state.Undo();
state.AssertNoTag();
// Resume rename tracking session
state.Undo();
state.AssertTag("Cat", "Cats");
}
}
示例15: RenameTrackingPreviewChanges
public void RenameTrackingPreviewChanges()
{
var code = @"
class C$$
{
}";
using (var state = new RenameTrackingTestState(code, LanguageNames.CSharp))
{
var mockPreview = state.Workspace.Services.GetService<IPreviewDialogService>() as MockPreviewDialogService;
mockPreview.Called = false;
mockPreview.ReturnsNull = false;
state.EditorOperations.InsertText("at");
state.AssertTag("C", "Cat", invokeAction: true, actionIndex: 1);
Assert.True(mockPreview.Called);
Assert.Equal("Rename 'C' to 'Cat':", mockPreview.Description);
Assert.Equal("Preview Changes - Rename", mockPreview.Title);
Assert.Equal("C", mockPreview.TopLevelName);
Assert.Equal(Glyph.ClassInternal, mockPreview.TopLevelGlyph);
}
}