本文整理汇总了C#中Microsoft.CodeAnalysis.Editor.UnitTests.RenameTracking.RenameTrackingTestState类的典型用法代码示例。如果您正苦于以下问题:C# RenameTrackingTestState类的具体用法?C# RenameTrackingTestState怎么用?C# RenameTrackingTestState使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
RenameTrackingTestState类属于Microsoft.CodeAnalysis.Editor.UnitTests.RenameTracking命名空间,在下文中一共展示了RenameTrackingTestState类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: RenameTrackingNotInBlankFile
public void RenameTrackingNotInBlankFile()
{
var code = @"$$";
using (var state = new RenameTrackingTestState(code, LanguageNames.CSharp))
{
state.EditorOperations.InsertText("d");
state.AssertNoTag();
}
}
开发者ID:elemk0vv,项目名称:roslyn-1,代码行数:9,代码来源:RenameTrackingTaggerProviderTests.cs
示例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);
}
}
开发者ID:nileshjagtap,项目名称:roslyn,代码行数:9,代码来源:RenameTrackingTaggerProviderTests.cs
示例3: RenameTrackingNotOnCreation
public void RenameTrackingNotOnCreation()
{
var code = @"
class C$$
{
}";
using (var state = new RenameTrackingTestState(code, LanguageNames.CSharp))
{
state.AssertNoTag();
}
}
开发者ID:elemk0vv,项目名称:roslyn-1,代码行数:11,代码来源:RenameTrackingTaggerProviderTests.cs
示例4: RenameTrackingNotOnCreation
public async Task RenameTrackingNotOnCreation()
{
var code = @"
class C$$
{
}";
using (var state = new RenameTrackingTestState(code, LanguageNames.CSharp))
{
await state.AssertNoTag().ConfigureAwait(true);
}
}
开发者ID:nileshjagtap,项目名称:roslyn,代码行数:11,代码来源:RenameTrackingTaggerProviderTests.cs
示例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);
}
}
开发者ID:nileshjagtap,项目名称:roslyn,代码行数:12,代码来源:RenameTrackingTaggerProviderTests.cs
示例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);
}
}
开发者ID:nileshjagtap,项目名称:roslyn,代码行数:12,代码来源:RenameTrackingTaggerProviderTests.cs
示例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");
}
}
开发者ID:elemk0vv,项目名称:roslyn-1,代码行数:12,代码来源:RenameTrackingTaggerProviderTests.cs
示例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");
}
}
开发者ID:elemk0vv,项目名称:roslyn-1,代码行数:12,代码来源:RenameTrackingTaggerProviderTests.cs
示例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");
}
}
开发者ID:elemk0vv,项目名称:roslyn-1,代码行数:12,代码来源:RenameTrackingTaggerProviderTests.cs
示例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();
}
}
开发者ID:elemk0vv,项目名称:roslyn-1,代码行数:14,代码来源:RenameTrackingTaggerProviderTests.cs
示例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();
}
}
开发者ID:elemk0vv,项目名称:roslyn-1,代码行数:30,代码来源:RenameTrackingTaggerProviderTests.cs
示例12: RenameTrackingDeleteFromEnd
public void RenameTrackingDeleteFromEnd()
{
var code = @"
class ABC$$
{
}";
using (var state = new RenameTrackingTestState(code, LanguageNames.CSharp))
{
state.EditorOperations.Backspace();
state.AssertTag("ABC", "AB");
}
}
开发者ID:elemk0vv,项目名称:roslyn-1,代码行数:12,代码来源:RenameTrackingTaggerProviderTests.cs
示例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();
}
}
开发者ID:elemk0vv,项目名称:roslyn-1,代码行数:14,代码来源:RenameTrackingTaggerProviderTests.cs
示例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");
}
}
开发者ID:elemk0vv,项目名称:roslyn-1,代码行数:29,代码来源:RenameTrackingTaggerProviderTests.cs
示例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);
}
}
开发者ID:elemk0vv,项目名称:roslyn-1,代码行数:21,代码来源:RenameTrackingTaggerProviderTests.cs
示例16: RenameTrackingUndoTwiceAndContinueSession
public void RenameTrackingUndoTwiceAndContinueSession()
{
var code = @"
class Cat$$
{
}";
using (var state = new RenameTrackingTestState(code, LanguageNames.CSharp))
{
state.EditorOperations.InsertText("abc");
state.AssertTag("Cat", "Catabc", invokeAction: true);
state.AssertNoTag();
// Resume rename tracking session
state.Undo(2);
state.AssertTag("Cat", "Catabc");
state.EditorOperations.InsertText("xyz");
state.AssertTag("Cat", "Catabcxyz");
}
}
开发者ID:elemk0vv,项目名称:roslyn-1,代码行数:21,代码来源:RenameTrackingTaggerProviderTests.cs
示例17: RenameTrackingRedoAlwaysClearsState
public void RenameTrackingRedoAlwaysClearsState()
{
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();
state.AssertNoTag();
state.Redo();
state.AssertNoTag();
}
}
开发者ID:elemk0vv,项目名称:roslyn-1,代码行数:24,代码来源:RenameTrackingTaggerProviderTests.cs
示例18: RenameTrackingUndoOnceAndStartNewSession
public void RenameTrackingUndoOnceAndStartNewSession()
{
var code = @"
class Cat$$
{
}";
using (var state = new RenameTrackingTestState(code, LanguageNames.CSharp))
{
state.EditorOperations.InsertText("abc");
state.AssertTag("Cat", "Catabc", invokeAction: true);
state.AssertNoTag();
// Back to original
state.Undo();
state.AssertNoTag();
state.EditorOperations.InsertText("xyz");
state.AssertTag("Cat", "Catxyz");
}
}
开发者ID:elemk0vv,项目名称:roslyn-1,代码行数:21,代码来源:RenameTrackingTaggerProviderTests.cs
示例19: RenameTrackingInvokeAndChangeBackToOriginal
public void RenameTrackingInvokeAndChangeBackToOriginal()
{
var code = @"
class Cat$$
{
}";
using (var state = new RenameTrackingTestState(code, LanguageNames.CSharp))
{
state.EditorOperations.InsertText("s");
state.AssertTag("Cat", "Cats", invokeAction: true);
state.AssertNoTag();
state.EditorOperations.Backspace();
state.AssertTag("Cats", "Cat");
}
}
开发者ID:elemk0vv,项目名称:roslyn-1,代码行数:17,代码来源:RenameTrackingTaggerProviderTests.cs
示例20: RenameTrackingReplaceIdentifierCompletely
public void RenameTrackingReplaceIdentifierCompletely()
{
var code = @"
class [|Cat|]$$
{
}";
using (var state = new RenameTrackingTestState(code, LanguageNames.CSharp))
{
var textSpan = state.HostDocument.SelectedSpans.Single();
state.EditorOperations.ReplaceText(new Span(textSpan.Start, textSpan.Length), "Dog");
state.AssertTag("Cat", "Dog");
}
}
开发者ID:elemk0vv,项目名称:roslyn-1,代码行数:13,代码来源:RenameTrackingTaggerProviderTests.cs
注:本文中的Microsoft.CodeAnalysis.Editor.UnitTests.RenameTracking.RenameTrackingTestState类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论