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 3dc5f35
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 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 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 3dc5f35

Please sign in to comment.