-
Notifications
You must be signed in to change notification settings - Fork 4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #63356 from dotnet/merges/release/dev17.4-vs-deps-…
…to-release/dev17.4 Merge release/dev17.4-vs-deps to release/dev17.4
- Loading branch information
Showing
21 changed files
with
415 additions
and
74 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
102 changes: 102 additions & 0 deletions
102
src/EditorFeatures/CSharpTest/SpellCheck/SpellCheckFixerProviderTests.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,102 @@ | ||
// Licensed to the .NET Foundation under one or more agreements. | ||
// The .NET Foundation licenses this file to you under the MIT license. | ||
// See the LICENSE file in the project root for more information. | ||
|
||
using System.Threading.Tasks; | ||
using Microsoft.CodeAnalysis.Editor.UnitTests.SpellCheck; | ||
using Microsoft.CodeAnalysis.Editor.UnitTests.Workspaces; | ||
using Microsoft.CodeAnalysis.Test.Utilities; | ||
using Roslyn.Test.Utilities; | ||
|
||
namespace Microsoft.CodeAnalysis.Editor.CSharp.UnitTests.SpellCheck | ||
{ | ||
[UseExportProvider] | ||
public class SpellCheckFixerProviderTests : AbstractSpellCheckFixerProviderTests | ||
{ | ||
protected override TestWorkspace CreateWorkspace(string content) | ||
=> TestWorkspace.CreateCSharp(content); | ||
|
||
[WpfFact] | ||
public async Task TestRenameClassName() | ||
{ | ||
await TestSuccessAsync( | ||
""" | ||
class {|CorrectlySpelled:CrrectlySpelled|} | ||
{ | ||
public CrrectlySpelled() { } | ||
} | ||
""", | ||
""" | ||
class CorrectlySpelled | ||
{ | ||
public CorrectlySpelled() { } | ||
} | ||
"""); | ||
} | ||
|
||
[WpfFact] | ||
public async Task TestBogusLocation() | ||
{ | ||
// Should not be called inside a string. But we should still apply the change. | ||
await TestFailureAsync( | ||
""" | ||
class C | ||
{ | ||
void M() | ||
{ | ||
var v1 = "{|word:wrd|}"; | ||
var v2 = "wrd"; | ||
} | ||
} | ||
""", | ||
""" | ||
class C | ||
{ | ||
void M() | ||
{ | ||
var v1 = "word"; | ||
var v2 = "wrd"; | ||
} | ||
} | ||
"""); | ||
} | ||
|
||
[WpfFact] | ||
public async Task TestReplacementThatLanguageDoesNotSupport() | ||
{ | ||
// Should not be called inside a string. But we should still apply the change. | ||
await TestFailureAsync( | ||
""" | ||
class {|Bo()gus:Orginal|} | ||
{ | ||
public Orginal() { } | ||
} | ||
""", | ||
""" | ||
class Bo()gus | ||
{ | ||
public Orginal() { } | ||
} | ||
"""); | ||
} | ||
|
||
[WpfFact] | ||
public async Task TestReplacementSpanLargerThanToken() | ||
{ | ||
// Replacement span is larger than the lang token to rename. | ||
await TestFailureAsync( | ||
""" | ||
class {|Replacement:Class |} | ||
{ | ||
public Class() { } | ||
} | ||
""", | ||
""" | ||
class Replacement | ||
{ | ||
public Class() { } | ||
} | ||
"""); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.