Skip to content

Commit 74fd44b

Browse files
authored
Update faking-auth.md
1 parent 95ed917 commit 74fd44b

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

docs/site/docs/test-doubles/faking-auth.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ The test implementation of Blazor's authentication and authorization can be put
1818
bUnit's authentication and authorization implementation is easily available by calling [`AddTestAuthorization()`](xref:Bunit.TestDoubles.FakeAuthorizationExtensions.AddTestAuthorization(Bunit.TestContextBase)) on a test context. This adds the necessary services to the `Services` collection and the `CascadingAuthenticationState` component to the [root render tree](xref:root-render-tree). The method returns an instance of the <xref:Bunit.TestDoubles.TestAuthorizationContext> type that allows you to control the authentication and authorization state for a test.
1919

2020
> [!NOTE]
21-
> If your test class inherits directly from bUnit's <xref:Bunit.TestContext>, as described in <xref:writing-csharp-tests#remove-boilerplate-code-from-tests>, then you need to call the [`AddTestAuthorization()`](xref:Bunit.TestDoubles.FakeAuthorizationExtensions.AddTestAuthorization(Bunit.TestContextBase)) method like so: `this.AddTestAuthorization()`.
21+
> If your test class inherits directly from bUnit's <xref:Bunit.TestContext>, as described in <xref:writing-csharp-tests#remove-boilerplate-code-from-tests>, then you need to call the [`AddTestAuthorization()`](xref:Bunit.TestDoubles.FakeAuthorizationExtensions.AddTestAuthorization(Bunit.TestContextBase)) method on `this`, since `AddTestAuthorization()` is an extension method, otherwise it wont be available. E.g.: `this.AddTestAuthorization()`.
2222
2323
The following sections show how to set each of these states in a test.
2424

0 commit comments

Comments
 (0)