Skip to content

Commit 14859b4

Browse files
committed
fix: docs references
1 parent f0b3ab0 commit 14859b4

File tree

8 files changed

+13
-44
lines changed

8 files changed

+13
-44
lines changed

.github/workflows/actions/docfx/Dockerfile

Lines changed: 0 additions & 19 deletions
This file was deleted.

.github/workflows/actions/docfx/action.yml

Lines changed: 0 additions & 11 deletions
This file was deleted.

.github/workflows/docs-deploy.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -81,9 +81,9 @@ jobs:
8181
run: dotnet test docs/samples/samples.sln
8282

8383
- name: 🛠️ Building docs
84-
uses: ./workflows/actions/docfx
85-
with:
86-
args: docs/site/docfx.json
84+
run: |
85+
dotnet tool update -g docfx --version 2.67.0
86+
docfx docs/site/docfx.json
8787
8888
- name: 🛠️ Deploy to GitHub Pages
8989
if: success()

docs/site/docs/interaction/trigger-renders.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ title: Triggering a render life cycle on a component
77

88
To trigger a re-render of a component under test, a reference to it through a <xref:Bunit.IRenderedComponent`1> type is needed. When using the <xref:Bunit.TestContext>'s `RenderComponent<TComponent>()` method, this is the type returned.
99

10-
In `.razor` based tests, using the <xref:Bunit.TestContext>'s <xref:Bunit.TestContext.Render``1(RenderFragment)> method also returns an <xref:Bunit.IRenderedComponent`1> (as opposed to the <xref:Bunit.TestContext.Render(Microsoft.AspNetCore.Components.RenderFragment)> method which returns the more simple <xref:Bunit.IRenderedFragment>).
10+
In `.razor` based tests, using the <xref:Bunit.TestContext>'s <xref:Bunit.TestContext.Render(Microsoft.AspNetCore.Components.RenderFragment)> method also returns an <xref:Bunit.IRenderedComponent`1> (as opposed to the <xref:Bunit.TestContext.Render(Microsoft.AspNetCore.Components.RenderFragment)> method which returns the more simple <xref:Bunit.IRenderedFragment>).
1111

1212
If you have a <xref:Bunit.IRenderedFragment> or a <xref:Bunit.IRenderedComponent`1> in a test, but need a child component's <xref:Bunit.IRenderedComponent`1>, then use the `FindComponent<TComponent>()` or the `FindComponents<TComponent>()` methods, which traverse down the render tree and finds rendered components.
1313

docs/site/docs/providing-input/controlling-component-instantiation.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ Components are, by default in bUnit, instantiated in the exact same way the regu
99

1010
It is however possible to control how Blazor components build using .NET 5 or newer are instantiated by bUnit. This enables the possibility to replace one component during testing with another, e.g., to replace a 3rd party component during testing with a "[stub component](https://en.wikipedia.org/wiki/Test_stub)", to make the test easier to write and maintain.
1111

12-
The following sections will describe how to use component factories to control instantiation of components during testing.
12+
The following sections will describe how to use component factories to control the instantiation of components during testing.
1313

1414
## Using component factories to control instantiation
1515

docs/site/docs/test-doubles/fake-navigation-manager.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -70,15 +70,15 @@ Assert.Equal("http://localhost/foo", navMan.Uri);
7070

7171
If a component issues multiple `NavigateTo` calls, then it is possible to inspect the navigation history by accessing the <xref:Bunit.TestDoubles.FakeNavigationManager.History> property. It's a stack based structure, meaning the latest navigations will be first in the collection at index 0.
7272

73-
## Asserting that a navigation was prevented with the `NavigationLock` component
73+
## Asserting that navigation was prevented with the `NavigationLock` component
7474

75-
The `NavigationLock` component, which was introduced with .NET 7, gives the possibility to intercept the navigation and can even prevent it. bUnit will always create a history entry for prevented or even failed interceptions. This gets reflected in the <xref:Bunit.TestDoubles.NavigationHistory.NavigationState> property, as well as in case of an exception on the <xref:Bunit.TestDoubles.NavigationHistory.Exception> property.
75+
The `NavigationLock` component, which was introduced with .NET 7, gives the possibility to intercept the navigation and can even prevent it. bUnit will always create a history entry for prevented or even failed interceptions. This gets reflected in the <xref:Bunit.TestDoubles.NavigationHistory> property.
7676

7777
A component can look like this:
7878
```razor
7979
@inject NavigationManager NavigationManager
8080
81-
<button @onclick="(() => NavigationManager.NavigateTo("/counter"))">Counter</button>
81+
<button @onclick="(() => NavigationManager.NavigateTo("/counter"))">Counter</button>
8282
8383
<NavigationLock OnBeforeInternalNavigation="InterceptNavigation"></NavigationLock>
8484

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,13 @@ The test implementation of Blazor's authentication and authorization can be put
1212
- **Authenticating**
1313
- **Unauthenticated** and **unauthorized**
1414
- **Authenticated** and **unauthorized**
15-
- **Authenticated** and **authorized**
15+
- **Authenticated** and **authorized**
1616
- **Authenticated** and **authorized** with one or more **roles**, **claims**, and/or **policies**
1717

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-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()`.
21+
> If your test class inherits directly from bUnit's <xref:Bunit.TestContext> 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

@@ -62,7 +62,7 @@ To set the state to authenticated and authorized, do the following:
6262

6363
[!code-csharp[UserInfoTest.cs](../../../samples/tests/xunit/UserInfoTest.cs?start=55&end=64&highlight=3)]
6464

65-
After calling `AddTestAuthorization()`, the returned <xref:Bunit.TestDoubles.TestAuthorizationContext> is used to set the authenticated and authorized state through the <xref:Bunit.TestDoubles.TestAuthorizationContext.SetAuthorized(System.String,Bunit.TestDoubles.AuthorizationState)> method.
65+
After calling `AddTestAuthorization()`, the returned <xref:Bunit.TestDoubles.TestAuthorizationContext> is used to set the authenticated and authorized state through the <xref:Bunit.TestDoubles.TestAuthorizationContext.SetAuthorized(System.String,Bunit.TestDoubles.AuthorizationState)> method.
6666

6767
Note that the second parameter, `AuthorizationState`, is optional, and defaults to `AuthorizationState.Authorized` if not specified.
6868

docs/site/docs/test-doubles/input-file.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ title: Uploading files to the InputFile component
77

88
bUnit comes with integrated support for the [`InputFile`](https://docs.microsoft.com/en-us/aspnet/core/blazor/file-uploads?view=aspnetcore-6.0&pivots=server) component and makes it easy to simulate uploading files.
99

10-
To upload a file, first find the `InputFile` component in the component under test. Afterwards call the method `UploadFile`:
10+
To upload a file, first find the `InputFile` component in the component under test. Afterward, call the method `UploadFile`:
1111

1212
```csharp
1313
// Create an InputFileContent with string content
@@ -25,5 +25,4 @@ inputFile.UploadFile(fileToUpload);
2525
// Assertions...
2626
```
2727

28-
To upload binary content, create an `InputFileContent` with the `InputFileContent.CreateFromBinary()` method.
29-
See all supported properties supported by the `InputFileContent` on its [reference page](xref:Bunit.InputFileContent).
28+
To upload binary content, create an `InputFileContent` with the `InputFileContent.CreateFromBinary()` method.

0 commit comments

Comments
 (0)