Skip to content

Commit af5ad4d

Browse files
committed
Docs workflow
1 parent 7054f5c commit af5ad4d

2 files changed

Lines changed: 19 additions & 5 deletions

File tree

.github/workflows/CI-CD-Docs.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,10 @@ jobs:
3838
dotnet build src/bunit.xunit/ --no-restore -p:version=$VERSION
3939
- name: Verfiy docs samples
4040
run: |
41-
dotnet test docs/samples/tests/mstest --no-restore
42-
dotnet test docs/samples/tests/nunit --no-restore
43-
dotnet test docs/samples/tests/razor --no-restore
44-
dotnet test docs/samples/tests/xunit --no-restore
41+
dotnet test docs/samples/tests/mstest
42+
dotnet test docs/samples/tests/nunit
43+
dotnet test docs/samples/tests/razor
44+
dotnet test docs/samples/tests/xunit
4545
- name: Building docs
4646
run: |
4747
dotnet build docs/site/

docs/site/docs/providing-input/passing-parameters-to-components.md

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ There are two methods in bUnit that allows passing parameters:
2020
- `RenderComponent` on the test context
2121
- `SetParametersAndRender` on a rendered component
2222

23-
In the following sub sections we will show both C# and Razor-based test code and Razor based test style, just click between them using the tabs.
23+
In the following sub sections we will show both C# and Razor-based test code, just click between them using the tabs.
2424

2525
> [!TIP]
2626
> In all examples below, the <xref:Bunit.ComponentParameterFactory> is imported into the test class using `using static Bunit.ComponentParameterFactory;`. This results in a lot less boilerplate code, which improves test readability.
@@ -55,6 +55,20 @@ Let's look at an example of passing parameter that takes types which or _not_ sp
5555
5656
[!code-csharp[AllKindsOfParams.razor](../../../samples/components/AllKindsOfParams.razor#L3-L7)]
5757
58+
# [C# test code](#tab/xunit)
59+
60+
```dotnetcli
61+
dotnet new xunit -o <NAME OF TEST PROJECT>
62+
```
63+
64+
# [Razor test code](#tab/nunit)
65+
66+
```dotnetcli
67+
dotnet new nunit -o <NAME OF TEST PROJECT>
68+
```
69+
70+
***
71+
5872
Using either C# tuples, a factory method or the parameter builder, this can be done like this:
5973
6074
[!code-csharp[](../../../samples/tests/xunit/AllKindsOfParamsTest.cs#L17-L39)]

0 commit comments

Comments
 (0)