Skip to content

Commit d63fd8a

Browse files
linkdotnetegil
authored andcommitted
use const string
1 parent be1070f commit d63fd8a

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

src/bunit.generators/Web.Stubs/StubGenerator.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ namespace Bunit.Web.Stubs;
1414
[Generator]
1515
public class StubGenerator : IIncrementalGenerator
1616
{
17-
private static string CascadingParameterAttributeQualifier;
17+
private const string CascadingParameterAttributeQualifier = "Microsoft.AspNetCore.Components.CascadingParameterAttribute";
1818
private const string ParameterAttributeQualifier = "Microsoft.AspNetCore.Components.ParameterAttribute";
1919

2020
/// <inheritdoc/>
@@ -27,7 +27,7 @@ public void Initialize(IncrementalGeneratorInitializationContext context)
2727
public static class ComponentFactoriesExtensions
2828
{
2929
/// <summary>
30-
/// Marks a component as a stub, so that a stub get is generated for it. The stub has the same name as the component, but with the suffix ""Stub"" added.
30+
/// Marks a component, so that a stub get is generated for it. The stub has the same name as the component, but with the suffix ""Stub"" added.
3131
/// </summary>
3232
/// <typeparam name=""TComponent"">The type of component to generate a stub for.</typeparam>
3333
/// <remarks>
@@ -131,10 +131,10 @@ private static bool GenerateStubComponent(StubClassInfo classInfo, SourceProduct
131131
var sourceBuilder = new StringBuilder();
132132

133133
sourceBuilder.AppendLine($"namespace {classInfo.TargetTypeNamespace};");
134+
sourceBuilder.AppendLine();
134135
sourceBuilder.AppendLine($"internal partial class {classInfo.StubClassName} : Microsoft.AspNetCore.Components.ComponentBase");
135136
sourceBuilder.Append("{");
136137

137-
CascadingParameterAttributeQualifier = "Microsoft.AspNetCore.Components.CascadingParameterAttribute";
138138
foreach (var member in targetTypeSymbol
139139
.GetMembers()
140140
.OfType<IPropertySymbol>()

0 commit comments

Comments
 (0)