-
Notifications
You must be signed in to change notification settings - Fork 0
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 #26 from mika-f/fix/invalid-constructor-renaming
- Loading branch information
Showing
3 changed files
with
47 additions
and
3 deletions.
There are no files selected for viewing
31 changes: 31 additions & 0 deletions
31
src/Plana.Composition.RenameSymbols.Tests/RenameSymbolsPluginTest _Classes.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,31 @@ | ||
// ------------------------------------------------------------------------------------------ | ||
// Copyright (c) Natsuneko. All rights reserved. | ||
// Licensed under the MIT License. See LICENSE in the project root for license information. | ||
// ------------------------------------------------------------------------------------------ | ||
|
||
using Microsoft.CodeAnalysis.CSharp.Syntax; | ||
|
||
using Plana.Testing; | ||
|
||
namespace Plana.Composition.RenameSymbols.Tests; | ||
|
||
public partial class RenameSymbolsPluginTest | ||
{ | ||
[Fact] | ||
public async Task RenameClasses_Constructor() | ||
{ | ||
var container = new PlanaContainer<RenameSymbolsPlugin>("rename-classes"); | ||
await container.RunAsync(); | ||
|
||
var reference = await container.GetSourceByPathAsync("Plana.Composition.Extensions/PlanaPluginOption.cs"); | ||
|
||
// PlanaPluginOption -> _0x4e115ed4 | ||
const string identifier = "_0x4e115ed4"; | ||
|
||
var @class = await reference.GetFirstSyntax<ClassDeclarationSyntax>(); | ||
Assert.Equal(identifier, @class.Identifier.ToFullString()); | ||
|
||
var constructor = await reference.GetFirstSyntax<ConstructorDeclarationSyntax>(); | ||
Assert.Equal(identifier, constructor.Identifier.ToFullString()); | ||
} | ||
} |
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