From 321210c54f44b375e5350e6b8e758d268647a4ef Mon Sep 17 00:00:00 2001 From: Martin Strecker Date: Wed, 24 Jan 2018 17:02:23 +0100 Subject: [PATCH] Fixes for Roslyn.Services.Editor.CSharp.UnitTests --- .../CSharpTest/AddUsing/AddUsingTests_NuGet.cs | 6 +++--- .../SymbolCompletionProviderTests.cs | 2 +- .../EditAndContinue/StatementEditingTests.cs | 6 +++--- .../CSharpTest/EditAndContinue/TopLevelEditingTests.cs | 8 ++++---- .../QuickInfo/SemanticQuickInfoSourceTests.cs | 10 +++++----- 5 files changed, 16 insertions(+), 16 deletions(-) diff --git a/src/EditorFeatures/CSharpTest/AddUsing/AddUsingTests_NuGet.cs b/src/EditorFeatures/CSharpTest/AddUsing/AddUsingTests_NuGet.cs index 9d12f9d4f9c..f991d65864f 100644 --- a/src/EditorFeatures/CSharpTest/AddUsing/AddUsingTests_NuGet.cs +++ b/src/EditorFeatures/CSharpTest/AddUsing/AddUsingTests_NuGet.cs @@ -150,7 +150,7 @@ public async Task TestOptionsOffered() { [|NuGetType|] n; }", -"Use local version '1.0'", +string.Format(FeaturesResources.Use_local_version_0, "1.0"), parameters: new TestParameters(fixProviderData: data)); await TestSmartTagTextAsync( @@ -158,7 +158,7 @@ public async Task TestOptionsOffered() { [|NuGetType|] n; }", -"Use local version '2.0'", +string.Format(FeaturesResources.Use_local_version_0, "2.0"), index: 1, parameters: new TestParameters(fixProviderData: data)); @@ -167,7 +167,7 @@ public async Task TestOptionsOffered() { [|NuGetType|] n; }", -"Find and install latest version", +FeaturesResources.Find_and_install_latest_version, index: 2, parameters: new TestParameters(fixProviderData: data)); } diff --git a/src/EditorFeatures/CSharpTest/Completion/CompletionProviders/SymbolCompletionProviderTests.cs b/src/EditorFeatures/CSharpTest/Completion/CompletionProviders/SymbolCompletionProviderTests.cs index bed975f2fe1..44b49ffc033 100644 --- a/src/EditorFeatures/CSharpTest/Completion/CompletionProviders/SymbolCompletionProviderTests.cs +++ b/src/EditorFeatures/CSharpTest/Completion/CompletionProviders/SymbolCompletionProviderTests.cs @@ -7486,7 +7486,7 @@ void goo() "; - var expectedDescription = $"(field) int C.x"; + var expectedDescription = $"({ FeaturesResources.field }) int C.x"; await VerifyItemInLinkedFilesAsync(markup, "x", expectedDescription); } diff --git a/src/EditorFeatures/CSharpTest/EditAndContinue/StatementEditingTests.cs b/src/EditorFeatures/CSharpTest/EditAndContinue/StatementEditingTests.cs index 9bdd99ef3fe..311e1248de8 100644 --- a/src/EditorFeatures/CSharpTest/EditAndContinue/StatementEditingTests.cs +++ b/src/EditorFeatures/CSharpTest/EditAndContinue/StatementEditingTests.cs @@ -4690,7 +4690,7 @@ static void Main(int X) var edits = GetTopEdits(src1, src2); edits.VerifyRudeDiagnostics( - Diagnostic(RudeEditKind.Renamed, "int X", "parameter")); + Diagnostic(RudeEditKind.Renamed, "int X", FeaturesResources.parameter)); } #endregion @@ -6694,7 +6694,7 @@ static void Main(int X) var edits = GetTopEdits(src1, src2); edits.VerifyRudeDiagnostics( - Diagnostic(RudeEditKind.Renamed, "int X", "parameter")); + Diagnostic(RudeEditKind.Renamed, "int X", FeaturesResources.parameter)); } [Fact] @@ -8521,7 +8521,7 @@ class C var edits = GetTopEdits(src1, src2); edits.VerifyRudeDiagnostics(ActiveStatementsDescription.Empty, - Diagnostic(RudeEditKind.ModifiersUpdate, "static void F()", "method")); + Diagnostic(RudeEditKind.ModifiersUpdate, "static void F()", FeaturesResources.method)); } [Fact] diff --git a/src/EditorFeatures/CSharpTest/EditAndContinue/TopLevelEditingTests.cs b/src/EditorFeatures/CSharpTest/EditAndContinue/TopLevelEditingTests.cs index 9c5d1c0cd46..e4f42c16fce 100644 --- a/src/EditorFeatures/CSharpTest/EditAndContinue/TopLevelEditingTests.cs +++ b/src/EditorFeatures/CSharpTest/EditAndContinue/TopLevelEditingTests.cs @@ -2641,7 +2641,7 @@ public Task WaitAsync() var edits = GetTopEdits(src1, src2); edits.VerifyRudeDiagnostics( Diagnostic(RudeEditKind.Delete, "await", CSharpFeaturesResources.await_expression), - Diagnostic(RudeEditKind.ModifiersUpdate, "public Task WaitAsync()", "method")); + Diagnostic(RudeEditKind.ModifiersUpdate, "public Task WaitAsync()", FeaturesResources.method)); } [Fact] @@ -7577,7 +7577,7 @@ public void Indexer_GetterAndSetterBlockBodiesToExpressionBody() "Delete [set { Console.WriteLine(0); }]@46"); edits.VerifyRudeDiagnostics( - Diagnostic(RudeEditKind.Delete, "int this[int a]", "indexer setter")); + Diagnostic(RudeEditKind.Delete, "int this[int a]", CSharpFeaturesResources.indexer_setter)); } [Fact, WorkItem(17681, "https://github.com/dotnet/roslyn/issues/17681")] @@ -7698,7 +7698,7 @@ public void TupleElementDelete() "Update [(int, int, int a) M() { return (1, 2, 3); }]@10 -> [(int, int) M() { return (1, 2); }]@10"); edits.VerifyRudeDiagnostics( - Diagnostic(RudeEditKind.TypeUpdate, "(int, int) M()", "method")); + Diagnostic(RudeEditKind.TypeUpdate, "(int, int) M()", FeaturesResources.method)); } [Fact] @@ -7713,7 +7713,7 @@ public void TupleElementAdd() "Update [(int, int) M() { return (1, 2); }]@10 -> [(int, int, int a) M() { return (1, 2, 3); }]@10"); edits.VerifyRudeDiagnostics( - Diagnostic(RudeEditKind.TypeUpdate, "(int, int, int a) M()", "method")); + Diagnostic(RudeEditKind.TypeUpdate, "(int, int, int a) M()", FeaturesResources.method)); } [Fact] diff --git a/src/EditorFeatures/CSharpTest/QuickInfo/SemanticQuickInfoSourceTests.cs b/src/EditorFeatures/CSharpTest/QuickInfo/SemanticQuickInfoSourceTests.cs index 78cdbe22fd9..4b341dd0570 100644 --- a/src/EditorFeatures/CSharpTest/QuickInfo/SemanticQuickInfoSourceTests.cs +++ b/src/EditorFeatures/CSharpTest/QuickInfo/SemanticQuickInfoSourceTests.cs @@ -4798,7 +4798,7 @@ public async Task OptionalParameterFromPreviousSubmission() "; using (var workspace = TestWorkspace.Create(XElement.Parse(workspaceDefinition), workspaceKind: WorkspaceKind.Interactive)) { - await TestWithOptionsAsync(workspace, MainDescription("(parameter) int x = 1")); + await TestWithOptionsAsync(workspace, MainDescription($"({ FeaturesResources.parameter }) int x = 1")); } } @@ -4843,7 +4843,7 @@ void M() } } " + TestResources.NetFX.ValueTuple.tuplelib_cs, - MainDescription("(local variable) ValueTuple y")); + MainDescription($"({ FeaturesResources.local_variable }) ValueTuple y")); } [WorkItem(18311, "https://github.com/dotnet/roslyn/issues/18311")] @@ -4879,7 +4879,7 @@ void M() } } " + TestResources.NetFX.ValueTuple.tuplelib_cs, - MainDescription("(local variable) ValueTuple y")); + MainDescription($"({ FeaturesResources.local_variable }) ValueTuple y")); } [WorkItem(18311, "https://github.com/dotnet/roslyn/issues/18311")] @@ -4915,7 +4915,7 @@ void M() } } " + TestResources.NetFX.ValueTuple.tuplelib_cs, - MainDescription("(local variable) (int, int) y")); + MainDescription($"({ FeaturesResources.local_variable }) (int, int) y")); } [WorkItem(18311, "https://github.com/dotnet/roslyn/issues/18311")] @@ -5189,7 +5189,7 @@ void method1() } } ", - MainDescription("(parameter) ? b")); + MainDescription($"({ FeaturesResources.parameter }) ? b")); } } } -- GitLab