當前位置: 首頁>>代碼示例>>C#>>正文


C# RenameTracking.RenameTrackingTestState類代碼示例

本文整理匯總了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();
     }
 }
開發者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


注:本文中的Microsoft.CodeAnalysis.Editor.UnitTests.RenameTracking.RenameTrackingTestState類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。