Skip to content

Commit

Permalink
use const string
Browse files Browse the repository at this point in the history
  • Loading branch information
linkdotnet committed Nov 28, 2023
1 parent 2c5f35b commit b3ff9e6
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/bunit.generators/Web.Stubs/StubGenerator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ namespace Bunit.Web.Stubs;
[Generator]
public class StubGenerator : IIncrementalGenerator
{
private static string CascadingParameterAttributeQualifier;
private const string CascadingParameterAttributeQualifier = "Microsoft.AspNetCore.Components.CascadingParameterAttribute";
private const string ParameterAttributeQualifier = "Microsoft.AspNetCore.Components.ParameterAttribute";

/// <inheritdoc/>
Expand All @@ -27,7 +27,7 @@ public void Initialize(IncrementalGeneratorInitializationContext context)
public static class ComponentFactoriesExtensions
{
/// <summary>
/// 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.
/// 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.
/// </summary>
/// <typeparam name=""TComponent"">The type of component to generate a stub for.</typeparam>
/// <remarks>
Expand Down Expand Up @@ -131,10 +131,10 @@ private static bool GenerateStubComponent(StubClassInfo classInfo, SourceProduct
var sourceBuilder = new StringBuilder();

sourceBuilder.AppendLine($"namespace {classInfo.TargetTypeNamespace};");
sourceBuilder.AppendLine();
sourceBuilder.AppendLine($"internal partial class {classInfo.StubClassName} : Microsoft.AspNetCore.Components.ComponentBase");
sourceBuilder.Append("{");

CascadingParameterAttributeQualifier = "Microsoft.AspNetCore.Components.CascadingParameterAttribute";
foreach (var member in targetTypeSymbol
.GetMembers()
.OfType<IPropertySymbol>()
Expand Down

0 comments on commit b3ff9e6

Please sign in to comment.