-
-
Notifications
You must be signed in to change notification settings - Fork 107
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Enable support for SupplyFrom cascading attributes
- Loading branch information
1 parent
77e8c54
commit 2722aca
Showing
4 changed files
with
56 additions
and
16 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
using Microsoft.CodeAnalysis; | ||
|
||
namespace Bunit.Web.Stubs; | ||
|
||
internal static class SupportedAttributes | ||
{ | ||
public const string CascadingParameterAttributeQualifier = "Microsoft.AspNetCore.Components.CascadingParameterAttribute"; | ||
public const string ParameterAttributeQualifier = "Microsoft.AspNetCore.Components.ParameterAttribute"; | ||
public const string SupplyParameterFromQueryAttributeQualifier = "Microsoft.AspNetCore.Components.SupplyParameterFromQueryAttribute"; | ||
public const string SupplyParameterFromFormAttributeQualifier = "Microsoft.AspNetCore.Components.SupplyParameterFromFormAttribute"; | ||
|
||
public static bool IsSupportedAttribute(AttributeData attribute) | ||
{ | ||
var displayString = attribute.AttributeClass?.ToDisplayString(); | ||
return displayString is ParameterAttributeQualifier or CascadingParameterAttributeQualifier or SupplyParameterFromQueryAttributeQualifier or SupplyParameterFromFormAttributeQualifier; | ||
} | ||
} |