本文整理汇总了C#中Microsoft.CodeAnalysis.Editor.UnitTests.RenameTracking.RenameTrackingTestState.AssertTag方法的典型用法代码示例。如果您正苦于以下问题:C# RenameTrackingTestState.AssertTag方法的具体用法?C# RenameTrackingTestState.AssertTag怎么用?C# RenameTrackingTestState.AssertTag使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Microsoft.CodeAnalysis.Editor.UnitTests.RenameTracking.RenameTrackingTestState
的用法示例。
在下文中一共展示了RenameTrackingTestState.AssertTag方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: 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");
}
}
示例2: 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);
}
}
示例3: 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);
}
}
示例4: RenameTrackingTypingAtBeginning
public void RenameTrackingTypingAtBeginning()
{
var code = @"
class $$C
{
}";
using (var state = new RenameTrackingTestState(code, LanguageNames.CSharp))
{
state.EditorOperations.InsertText("AB");
state.AssertTag("C", "ABC");
}
}
示例5: RenameTrackingTypingAtEnd
public void RenameTrackingTypingAtEnd()
{
var code = @"
class C$$
{
}";
using (var state = new RenameTrackingTestState(code, LanguageNames.CSharp))
{
state.EditorOperations.InsertText("at");
state.AssertTag("C", "Cat");
}
}
示例6: 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");
}
}
示例7: 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();
}
}
示例8: RenameTrackingDeleteFromEnd
public void RenameTrackingDeleteFromEnd()
{
var code = @"
class ABC$$
{
}";
using (var state = new RenameTrackingTestState(code, LanguageNames.CSharp))
{
state.EditorOperations.Backspace();
state.AssertTag("ABC", "AB");
}
}
示例9: RenameTrackingHandlesSquareBracketsAsVisualBasicEscape
public void RenameTrackingHandlesSquareBracketsAsVisualBasicEscape()
{
var code = @"
Class $$C
End Class";
using (var state = new RenameTrackingTestState(code, LanguageNames.VisualBasic))
{
state.EditorOperations.InsertText("[");
state.AssertNoTag();
state.MoveCaret(1);
state.EditorOperations.InsertText("]");
state.AssertTag("C", "[C]");
}
}
示例10: 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();
}
}
示例11: RenameTrackingOnReference_Namespace
public void RenameTrackingOnReference_Namespace()
{
var code = @"
namespace NS
{
class C
{
static void M()
{
NS$$.C.M();
}
}
}";
using (var state = new RenameTrackingTestState(code, LanguageNames.CSharp))
{
state.EditorOperations.InsertText("A");
state.AssertTag("NS", "NSA");
}
}
示例12: RenameTrackingReplaceIdentifierPrefix
public void RenameTrackingReplaceIdentifierPrefix()
{
var code = @"
class $$[|Ident|]ifier
{
}";
using (var state = new RenameTrackingTestState(code, LanguageNames.CSharp))
{
var textSpan = state.HostDocument.SelectedSpans.Single();
state.EditorOperations.ReplaceText(new Span(textSpan.Start, textSpan.Length), "Complex");
state.AssertTag("Identifier", "Complexifier");
}
}
示例13: RenameTrackingThroughEmptyStringWithCaretMove
public void RenameTrackingThroughEmptyStringWithCaretMove()
{
var code = @"
class C$$
{
}";
using (var state = new RenameTrackingTestState(code, LanguageNames.CSharp))
{
state.EditorOperations.Backspace();
state.MoveCaret(-4);
state.MoveCaret(4);
state.AssertNoTag();
state.EditorOperations.InsertText("D");
state.AssertTag("C", "D");
}
}
示例14: RenameTrackingThroughSameIdentifier
public void RenameTrackingThroughSameIdentifier()
{
var code = @"
class C$$
{
}";
using (var state = new RenameTrackingTestState(code, LanguageNames.CSharp))
{
state.EditorOperations.InsertText("s");
state.AssertTag("C", "Cs");
state.EditorOperations.Backspace();
state.AssertNoTag();
state.EditorOperations.InsertText("s");
state.AssertTag("C", "Cs");
}
}
示例15: RenameTrackingOnBothSidesOfIdentifier
public void RenameTrackingOnBothSidesOfIdentifier()
{
var code = @"
class $$Def
{
}";
using (var state = new RenameTrackingTestState(code, LanguageNames.CSharp))
{
state.EditorOperations.InsertText("Abc");
state.AssertTag("Def", "AbcDef");
state.MoveCaret(3);
state.EditorOperations.InsertText("Ghi");
state.AssertTag("Def", "AbcDefGhi");
}
}