Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release of new minor version v1.27 #1405

Merged
merged 56 commits into from
Mar 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
56 commits
Select commit Hold shift + click to select a range
9e03742
Set version to '1.27-preview'
bUnitBot Dec 20, 2023
5285014
Merge branch 'release/v1.26'
bUnitBot Dec 20, 2023
f770836
Merge branch 'stable'
bUnitBot Dec 20, 2023
9001a7e
Merge branch 'stable'
bUnitBot Dec 20, 2023
d546c4e
build(deps): Bump SonarAnalyzer.CSharp from 9.15.0.81779 to 9.16.0.82469
dependabot[bot] Dec 21, 2023
b413d32
docs: Update CHANGELOG.md
linkdotnet Dec 22, 2023
c2e2bdc
fix: Wrong output for gemerator package
linkdotnet Dec 28, 2023
3adb978
chore: Update packages
linkdotnet Dec 28, 2023
58f7180
refactor: Added indicator for auto-generated code and nullability+
linkdotnet Dec 28, 2023
8d47edd
build(deps): Bump Verify.Xunit from 22.8.0 to 22.11.1
dependabot[bot] Dec 28, 2023
9314f89
build(deps): Bump Verify.Xunit from 22.11.1 to 22.11.2
dependabot[bot] Jan 4, 2024
8323b3a
refactor: Remove pragma
linkdotnet Jan 5, 2024
f7fb121
feat: Add diagnostics for source generators
linkdotnet Jan 5, 2024
c8ba524
feat: add help url for diagnostics
linkdotnet Jan 5, 2024
53a2e58
chore: Update packages
linkdotnet Jan 8, 2024
177fb26
chore: Update Verify.Xunit
linkdotnet Jan 8, 2024
4929971
build(deps): Bump System.Text.Json from 8.0.0 to 8.0.1
dependabot[bot] Jan 9, 2024
62bab18
build(deps): Bump Meziantou.Polyfill from 1.0.31 to 1.0.32
dependabot[bot] Jan 10, 2024
ebdde9b
build(deps): Bump Verify.Xunit from 22.11.4 to 22.11.5
dependabot[bot] Jan 10, 2024
5f64044
build(deps): Bump docfx from 2.74.1 to 2.75.0
dependabot[bot] Jan 12, 2024
604e98d
Perf generators (#1357)
linkdotnet Jan 26, 2024
0fb7d2f
fix: Remove flakiness from DisposeComponents test
linkdotnet Jan 26, 2024
a702bea
chore: Bump Packages
linkdotnet Jan 26, 2024
cdfbad7
fix: Remove obsolete attribute
linkdotnet Jan 26, 2024
df0c3bb
build(deps): Bump docfx from 2.75.0 to 2.75.1
dependabot[bot] Jan 15, 2024
4b8adc0
build(deps): Bump actions/dependency-review-action from 3 to 4
dependabot[bot] Jan 18, 2024
5d4e35f
build(deps): Bump SonarAnalyzer.CSharp from 9.18.0.83559 to 9.19.0.84025
dependabot[bot] Jan 31, 2024
02ac125
build(deps): Bump dotnet/nbgv from 0.4.1 to 0.4.2
dependabot[bot] Jan 29, 2024
77e8c54
build(deps): Bump docfx from 2.75.1 to 2.75.2
dependabot[bot] Jan 29, 2024
2722aca
feat: Enable support for SupplyFrom cascading attributes
linkdotnet Feb 4, 2024
9126213
docs: Fix links and formatting
linkdotnet Feb 3, 2024
e69f717
build(deps): Bump Verify.Xunit from 23.0.1 to 23.1.0
dependabot[bot] Feb 5, 2024
ac0b0b7
chore: Bump version and remove redundant project reference
linkdotnet Feb 7, 2024
27f8bb6
ci: remove blame from test runs
egil Feb 13, 2024
e259795
feat: Added support for keyed services (#1374)
linkdotnet Feb 14, 2024
3cbfc49
build(deps): Bump thomaseizinger/keep-a-changelog-new-release
dependabot[bot] Feb 14, 2024
706483b
build(deps): Bump Verify.Xunit from 23.1.0 to 23.2.0
dependabot[bot] Feb 15, 2024
6ba8b1f
build(deps): Bump docfx from 2.75.2 to 2.75.3
dependabot[bot] Feb 19, 2024
465e2cc
build(deps): Bump xunit from 2.6.6 to 2.7.0
dependabot[bot] Feb 16, 2024
d97c47c
build(deps): Bump SonarAnalyzer.CSharp from 9.19.0.84025 to 9.20.0.85982
dependabot[bot] Feb 20, 2024
c75337d
build(deps): Bump coverlet.msbuild from 6.0.0 to 6.0.1
dependabot[bot] Feb 21, 2024
8f99afa
feat: Support supplying parameters as query string
linkdotnet Feb 16, 2024
f8d4a8c
docs: Added examples for query strings in net8
linkdotnet Feb 23, 2024
156822b
Revert "docs: Added examples for query strings in net8"
linkdotnet Feb 23, 2024
29cbac0
build(deps): Bump xunit.assert from 2.6.6 to 2.7.0
dependabot[bot] Feb 26, 2024
ab5512b
build(deps): Bump xunit.extensibility.execution from 2.6.6 to 2.7.0
dependabot[bot] Feb 26, 2024
8ccc74c
build(deps): Bump Verify.Xunit and xunit.extensibility.execution
dependabot[bot] Feb 21, 2024
e1ccc75
build(deps): Bump System.Text.Json from 8.0.1 to 8.0.2
dependabot[bot] Feb 26, 2024
67e61b6
build(deps): Bump Verify.Xunit from 23.2.1 to 23.2.2
dependabot[bot] Feb 27, 2024
772f874
build(deps): Bump Meziantou.Polyfill from 1.0.33 to 1.0.35
dependabot[bot] Feb 28, 2024
20479f6
build(deps): Bump Meziantou.Polyfill from 1.0.35 to 1.0.36
dependabot[bot] Feb 29, 2024
5d4c799
chore: Update AngleSharp dependencies for net6 and higher
linkdotnet Feb 29, 2024
7568c17
docs: Added examples for query strings in net8
linkdotnet Feb 23, 2024
80a8010
Update docs/site/docs/providing-input/passing-parameters-to-component…
linkdotnet Feb 27, 2024
b859378
feat: Added support for net9.0 (#1404)
linkdotnet Mar 2, 2024
289bd9d
Set version to '1.27'
bUnitBot Mar 2, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .config/dotnet-tools.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
]
},
"docfx": {
"version": "2.74.1",
"version": "2.75.3",
"commands": [
"docfx"
]
Expand Down
13 changes: 8 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,10 @@ jobs:
6.0.x
7.0.x
8.0.x
9.0.x

- name: ⚙️ Setup GIT versioning
uses: dotnet/nbgv@v0.4.1
uses: dotnet/nbgv@v0.4.2
with:
setAllVars: true

Expand Down Expand Up @@ -109,7 +110,7 @@ jobs:
- name: Validate package
shell: pwsh
run: meziantou.validate-nuget-package (Get-ChildItem "${{ env.NUGET_DIRECTORY }}/*.nupkg") --excluded-rules IconMustBeSet

run-test:
strategy:
fail-fast: false
Expand All @@ -132,6 +133,7 @@ jobs:
6.0.x
7.0.x
8.0.x
9.0.x

- name: 🧪 Run unit tests
run: dotnet test -c release --blame --blame-crash --blame-hang
Expand Down Expand Up @@ -163,7 +165,7 @@ jobs:
path: ${{ env.NUGET_DIRECTORY }}

- name: ⚙️ Setup GIT versioning
uses: dotnet/nbgv@v0.4.1
uses: dotnet/nbgv@v0.4.2
with:
setAllVars: true

Expand Down Expand Up @@ -209,9 +211,10 @@ jobs:
6.0.x
7.0.x
8.0.x
9.0.x

- name: ⚙️ Setup GIT versioning
uses: dotnet/nbgv@v0.4.1
uses: dotnet/nbgv@v0.4.2
with:
setAllVars: true

Expand Down Expand Up @@ -245,7 +248,7 @@ jobs:
- name: 'Checkout Repository'
uses: actions/checkout@v4
- name: 'Dependency Review'
uses: actions/dependency-review-action@v3
uses: actions/dependency-review-action@v4

release-preview:
if: github.event_name == 'workflow_dispatch' && (github.ref == 'refs/heads/main' || github.ref == 'refs/heads/v2')
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/docs-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ jobs:
git config --global commit.gpgsign true

- name: ⚙️ Setup GIT versioning
uses: dotnet/nbgv@v0.4.1
uses: dotnet/nbgv@v0.4.2
with:
setAllVars: true

Expand All @@ -77,6 +77,7 @@ jobs:
6.0.x
7.0.x
8.0.x
9.0.x

- name: 🎨 Setup color
run: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/prepare-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ jobs:
git config --global commit.gpgsign true

- name: ⚙️ Setup GIT versioning
uses: dotnet/nbgv@v0.4.1
uses: dotnet/nbgv@v0.4.2
with:
setAllVars: true

Expand Down
5 changes: 3 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ jobs:
git config --global commit.gpgsign true

- name: ⚙️ Setup GIT versioning
uses: dotnet/nbgv@v0.4.1
uses: dotnet/nbgv@v0.4.2
with:
setAllVars: true

Expand All @@ -62,9 +62,10 @@ jobs:
6.0.x
7.0.x
8.0.x
9.0.x

- name: 🛠️ Update changelog
uses: thomaseizinger/keep-a-changelog-new-release@1.3.0
uses: thomaseizinger/keep-a-changelog-new-release@2.0.0
with:
version: ${{ env.NBGV_SemVer2 }}

Expand Down
9 changes: 8 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,18 @@ All notable changes to **bUnit** will be documented in this file. The project ad

## [Unreleased]

### Added
- Support for `IKeyedServiceProvider` in net8.0. Reported by [@ViRuSTriNiTy](https://github.com/ViRuSTriNiTy). By [@linkdotnet](https://github.com/linkdotnet).
- Support for `net9.0`. NOTE, there is no commitment as of now to support net9.0 in bUnit v1. However. Support for net9.0 may move to a future v2 release of bUnit and be deprecated in v1. However, allowing bUnit to build and work with net9.0 previews allows our users to keep testing!

### Fixed
- Support for `SupplyFromQueryParameter` in net8.0. Reported by [@aayjaychan](https://github.com/aayjaychan). Fixed by [@egil](https://github.com/egil) and [@linkdotnet](https://github.com/linkdotnet).

## [1.26.64] - 2023-12-20

### Changed

- Upgraded AngleSharp to 1.0.7.
- Upgraded AngleSharp to 1.0.7. Info: The usage of `AngleSharpWrappers` is not needed anymore. Any usage of `Unwrap` should not be needed anymore.

### Fixed

Expand Down
3 changes: 2 additions & 1 deletion Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
<DotNet6Version>6.0.*</DotNet6Version>
<DotNet7Version>7.0.*</DotNet7Version>
<DotNet8Version>8.0.*</DotNet8Version>
<DotNet9Version>9.0.0-*</DotNet9Version>
</PropertyGroup>

<!-- Solution wide properties -->
Expand Down Expand Up @@ -51,7 +52,7 @@
<!-- Shared code analyzers used for all projects in the solution -->
<ItemGroup Label="Code Analyzers">
<PackageReference Include="AsyncFixer" Version="1.6.0" PrivateAssets="All" />
<PackageReference Include="SonarAnalyzer.CSharp" Version="9.15.0.81779" PrivateAssets="All" />
<PackageReference Include="SonarAnalyzer.CSharp" Version="9.20.0.85982" PrivateAssets="All" />
</ItemGroup>

<ItemGroup Label="Implicit usings"
Expand Down
4 changes: 2 additions & 2 deletions benchmark/bunit.benchmarks/bunit.benchmarks.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="BenchmarkDotNet" Version="0.13.11" />
<PackageReference Include="BenchmarkDotNet" Version="0.13.12" />
</ItemGroup>

<ItemGroup>
Expand All @@ -17,4 +17,4 @@
<ProjectReference Include="..\bunit.benchmarks.assets\bunit.benchmarks.assets.csproj" />
</ItemGroup>

</Project>
</Project>
4 changes: 2 additions & 2 deletions bunit.sln
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,11 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "bunit.testassets", "tests\b
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".workflows", ".workflows", "{3B2F3419-5336-4147-A212-E19091195203}"
ProjectSection(SolutionItems) = preProject
.github\workflows\ci.yml = .github\workflows\ci.yml
.github\workflows\docs-deploy.yml = .github\workflows\docs-deploy.yml
.github\workflows\prepare-release.yml = .github\workflows\prepare-release.yml
.github\workflows\release-preview.yml = .github\workflows\release-preview.yml
.github\workflows\release.yml = .github\workflows\release.yml
.github\workflows\verification.yml = .github\workflows\verification.yml
EndProjectSection
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "benchmark", "benchmark", "{F6084D31-2A92-4794-A47E-A8F2254E6970}"
Expand All @@ -72,7 +72,7 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "bunit.generators.internal",
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "bunit.generators.tests", "tests\bunit.generators.tests\bunit.generators.tests.csproj", "{09046981-D9EC-4295-8502-721AC54E1F12}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "bunit.generators", "src\bunit.generators\bunit.generators.csproj", "{A7C6A2AA-FF8F-4ED1-8590-5324FC566059}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "bunit.generators", "src\bunit.generators\bunit.generators.csproj", "{A7C6A2AA-FF8F-4ED1-8590-5324FC566059}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Expand Down
8 changes: 8 additions & 0 deletions docs/site/docs/extensions/bunit-generators.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,3 +82,11 @@ internal partial class ThirdPartyStub { }
```

Current limitations of this approach is that he stubbed type is not allowed to be nested inside the test class.

## Reported Diagnostics
The generators will report a range of diagnostics to help understanding what issue is present. The following table shows the diagnostics that are reported.

| Diagnostic ID | Error | Severity | Description |
| ------------- | ----------------------------------------------- | -------- | ---------------------------------------------------------------------------- |
| BUNIT0001 | Stubbing nested classes ({0}) is not supported. | Warning | Types annotated with `ComponentStub` can not be nested inside another class. |
| BUNIT0002 | Class ({0}) is not partial. | Warning | Types annotated with `ComponentStub` must be partial. |
34 changes: 34 additions & 0 deletions docs/site/docs/providing-input/passing-parameters-to-components.md
Original file line number Diff line number Diff line change
Expand Up @@ -466,6 +466,40 @@ When rendering a `RenderFragment` using the <xref:Bunit.TestContext.Render(Micro
}
```

## Passing query parameters (`SupplyParameterFromQuery`) to a component
In .NET 6 and later, components can receive parameters from a query string if the parameter is annotated with the `[SupplyParameterFromQuery]` attribute in addition to the `[Parameter]` attribute.

In .NET 8 however, the `[Parameter]` attribute is no longer required, which means a value cannot be passed to the component during testing using the normal methods, e.g. the <xref:Bunit.ComponentParameterCollectionBuilder`1>'s `Add` method, if a component parameter is only annotated with the `[SupplyParameterFromQuery]` attribute. Instead, pass a query string parameters by setting it using the <xref:Bunit.TestDoubles.FakeNavigationManager>.

For example:

```razor
@code {
[SupplyParameterFromQuery]
public string Name { get; set; }
}
```

A simple example of how to test a component that receives parameters from the query string:

```razor
@inherits TestContext

@code {
[Fact]
public void Component_receives_parameters_from_query_string()
{
var navigationManager = Services.GetRequiredService<NavigationManager>();
var uri = navigationManager.GetUriWithQueryParameter("Name", "bUnit");
navigationManager.NavigateTo(uri);

var cut = RenderComponent<SupplyFromQueryParameterComponent>();

cut.Instance.Name.ShouldBe("bUnit");
}
}
```

## Further Reading

- <xref:inject-services>
6 changes: 5 additions & 1 deletion docs/site/docs/test-doubles/mocking-localizer.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,15 @@ title: Mocking Localization via IStringLocalizer
---

<p>There are just two steps. First in your setup add the following:</p>

```csharp
TestContext.Services.AddLocalization();
```

<p>Then in your test code, when you need the localized string to compare, you write the following:</p>

```csharp
var localizer = ctx.Services.GetService<IStringLocalizer<SharedStrings>>();
```
```

<p>Where SharedStrings.cs (you can name this anything you want) that has the resource files such as `SharedStrings.en.resx`</p>
1 change: 1 addition & 0 deletions docs/site/docs/toc.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
## [Emulating IJSRuntime](xref:emulating-ijsruntime)
## [Faking authorization](xref:faking-auth)
## [Mocking HttpClient](xref:mocking-httpclient)
## [Mocking Localizer](xref:mocking-localizer)
## [Faking PersistentComponentState](xref:faking-persistentcomponentstate)
## [Faking NavigationManager](xref:fake-navigation-manager)
## [Faking IWebAssemblyHostEnvironment](xref:fake-webassemblyhostenvironment)
Expand Down
2 changes: 1 addition & 1 deletion global.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"sdk": {
"rollForward": "latestMajor",
"allowPrerelease": false
"allowPrerelease": true
}
}
54 changes: 52 additions & 2 deletions src/bunit.core/ComponentParameterCollectionBuilder.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
using System.Linq.Expressions;
using System.Reflection;
using System.Runtime.CompilerServices;
using Bunit.Extensions;
using Bunit.Rendering;

namespace Bunit;

Expand Down Expand Up @@ -48,7 +50,11 @@ public ComponentParameterCollectionBuilder(Action<ComponentParameterCollectionBu
/// <returns>This <see cref="ComponentParameterCollectionBuilder{TComponent}"/>.</returns>
public ComponentParameterCollectionBuilder<TComponent> Add<TValue>(Expression<Func<TComponent, TValue>> parameterSelector, [AllowNull] TValue value)
{
#if !NET8_0_OR_GREATER
var (name, cascadingValueName, isCascading) = GetParameterInfo(parameterSelector);
#else
var (name, cascadingValueName, isCascading) = GetParameterInfo(parameterSelector, value);
#endif
return isCascading
? AddCascadingValueParameter(cascadingValueName, value)
: AddParameter<TValue>(name, value);
Expand Down Expand Up @@ -338,7 +344,11 @@ public ComponentParameterCollectionBuilder<TComponent> Bind<TValue>(
Action<TValue> changedAction,
Expression<Func<TValue>>? valueExpression = null)
{
#if !NET8_0_OR_GREATER
var (parameterName, _, isCascading) = GetParameterInfo(parameterSelector);
#else
var (parameterName, _, isCascading) = GetParameterInfo(parameterSelector, initialValue);
#endif

if (isCascading)
throw new ArgumentException("Using Bind with a cascading parameter is not allowed.", parameterName);
Expand Down Expand Up @@ -393,7 +403,7 @@ static string TrimEnd(string source, string value)
/// or a <see cref="CascadingParameterAttribute"/>.
/// </summary>
/// <remarks>
/// This is an untyped version of the <see cref="Add{TValue}(Expression{Func{TComponent, TValue}}, TValue)"/> method. Always
/// This is an untyped version of this method named <see cref="AddUnmatched"/>. Always
/// prefer the strongly typed <c>Add</c> methods whenever possible.
/// </remarks>
/// <typeparam name="TValue">Value type.</typeparam>
Expand Down Expand Up @@ -426,7 +436,12 @@ public bool TryAdd<TValue>(string name, [AllowNull] TValue value)
/// <returns>The created <see cref="ComponentParameterCollection"/>.</returns>
public ComponentParameterCollection Build() => parameters;

private static (string Name, string? CascadingValueName, bool IsCascading) GetParameterInfo<TValue>(Expression<Func<TComponent, TValue>> parameterSelector)
private static (string Name, string? CascadingValueName, bool IsCascading) GetParameterInfo<TValue>(
Expression<Func<TComponent, TValue>> parameterSelector
#if NET8_0_OR_GREATER
, object? value
#endif
)
{
if (parameterSelector is null)
throw new ArgumentNullException(nameof(parameterSelector));
Expand All @@ -439,12 +454,47 @@ private static (string Name, string? CascadingValueName, bool IsCascading) GetPa
: propInfoCandidate;

var paramAttr = propertyInfo?.GetCustomAttribute<ParameterAttribute>(inherit: true);
#if !NET8_0_OR_GREATER
var cascadingParamAttr = propertyInfo?.GetCustomAttribute<CascadingParameterAttribute>(inherit: true);

if (propertyInfo is null || (paramAttr is null && cascadingParamAttr is null))
throw new ArgumentException($"The parameter selector '{parameterSelector}' does not resolve to a public property on the component '{typeof(TComponent)}' with a [Parameter] or [CascadingParameter] attribute.", nameof(parameterSelector));

return (propertyInfo.Name, CascadingValueName: cascadingParamAttr?.Name, IsCascading: cascadingParamAttr is not null);
#else
var cascadingParamAttrBase = propertyInfo?.GetCustomAttribute<CascadingParameterAttributeBase>(inherit: true);

if (propertyInfo is null || (paramAttr is null && cascadingParamAttrBase is null))
throw new ArgumentException($"The parameter selector '{parameterSelector}' does not resolve to a public property on the component '{typeof(TComponent)}' with a [Parameter] or [CascadingParameter]attribute.", nameof(parameterSelector));

if (cascadingParamAttrBase is null)
return (propertyInfo.Name, CascadingValueName: null, IsCascading: false);

var name = cascadingParamAttrBase switch
{
CascadingParameterAttribute cpa => cpa.Name,
SupplyParameterFromQueryAttribute s => throw CreateErrorMessageForSupplyFromQuery(value, propertyInfo, s.Name),
_ => throw new NotSupportedException($"The type '{cascadingParamAttrBase.GetType()}' is not supported"),
};

return (propertyInfo.Name, CascadingValueName: name, IsCascading: true);

static ArgumentException CreateErrorMessageForSupplyFromQuery(
object? value,
MemberInfo propertyInfo,
string? name)
{
var cascadingParameterName = name ?? propertyInfo.Name;

return new ArgumentException($"""
To pass a value to a SupplyParameterFromQuery parameter, use the NavigationManager and navigate to the URI.
For example:

var uri = NavigationManager.GetUriWithQueryParameter("{cascadingParameterName}", "{value}");
NavigationManager.NavigateTo(uri);
""");
}
#endif
}

private static bool HasChildContentParameter()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public static void SetParametersAndRender<TComponent>(this IRenderedComponentBas
if (renderedComponent is null)
throw new ArgumentNullException(nameof(renderedComponent));

var renderer = renderedComponent.Services.GetRequiredService<TestRenderer>();
var renderer = (TestRenderer)renderedComponent.Services.GetRequiredService<TestContextBase>().Renderer;

try
{
Expand Down
Loading
Loading