Skip to content

Commit d235fe1

Browse files
committed
fix: allowed all occurrences
1 parent 6243a33 commit d235fe1

2 files changed

Lines changed: 7 additions & 2 deletions

File tree

src/bunit.web/TestDoubles/Authorization/FakeAuthorizationExtensions.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,9 @@ public static TestAuthorizationContext AddTestAuthorization(this TestContextBase
2121

2222
context.RenderTree.TryAdd<CascadingAuthenticationState>();
2323
context.Services.AddSingleton<FakeSignOutSessionStateManager>();
24+
#pragma warning disable CS0618
2425
context.Services.AddSingleton<SignOutSessionStateManager>(s => s.GetRequiredService<FakeSignOutSessionStateManager>());
26+
#pragma warning restore CS0618
2527
var authCtx = new TestAuthorizationContext();
2628
authCtx.SetNotAuthorized();
2729
authCtx.RegisterAuthorizationServices(context.Services);

tests/bunit.testassets/SampleComponents/SignOutSessionManagerLoginDisplay.razor

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
@using Microsoft.AspNetCore.Components.Authorization
22
@using Microsoft.AspNetCore.Components.WebAssembly.Authentication
3-
@inject SignOutSessionStateManager signOutManager
43

54
<AuthorizeView>
65
<Authorized>
@@ -14,8 +13,12 @@
1413
</AuthorizeView>
1514

1615
@code {
16+
#pragma warning disable CS0618
17+
[Inject] SignOutSessionStateManager SignOutManager { get;set;} = default!;
18+
#pragma warning restore CS0618
19+
1720
private async Task BeginSignOut(MouseEventArgs args)
1821
{
19-
await signOutManager.SetSignOutState();
22+
await SignOutManager.SetSignOutState();
2023
}
2124
}

0 commit comments

Comments
 (0)