Skip to content

Commit

Permalink
Merge stable into main (#1050)
Browse files Browse the repository at this point in the history
* docs: Use TestContext as base class for Passing parameters to components (#1034)

* refactor: Use TestContext as base class

* fixes to docs

* Indent size 2

* fix getting started and index

---------

Co-authored-by: Egil Hansen <egil@assimilated.dk>

* docs: broken sample code

* doc: fixes to sample code to make it compile

* docs: added CounterTest.razor

* docs: fix code references, added missing samples

* docs: change code ref to correct type

---------

Co-authored-by: Egil Hansen <egil@assimilated.dk>
  • Loading branch information
linkdotnet and egil authored Apr 26, 2023
1 parent 37e4495 commit cfd7be2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion docs/site/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ Let’s write a test for the `<Counter>` component listed below. This comes with

To do this, you can carry out the following using bUnit and xUnit:

[!code-csharp[CounterTest.cs](../samples/tests/razor/CounterTest.razor)]
[!code-cshtml[CounterTest.razor](../samples/tests/razor/CounterTest.razor)]

This test uses bUnit's test context to render the `Counter` component with the `Render` method. It then finds the button the component rendered and clicks it with the `Find` and `Click` methods. Finally, it finds the paragraph (`<p>`) element and verifies that it matches the expected markup passed to the MarkupMatches method.

Expand Down

0 comments on commit cfd7be2

Please sign in to comment.