Skip to content

Commit ff4a66c

Browse files
committed
docs: tweaks to js mocking
1 parent 78ec7fe commit ff4a66c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

docs/site/docs/test-doubles/mocking-ijsruntime.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,15 @@ title: Mocking Blazor's IJSRuntime
77

88
It is common for Blazor components to use `IJSRuntime` to call JavaScript, and since bUnit does not run JavaScript, mocking `IJSRuntime` is needed for components that uses it. In that regard, `IJSRuntime` is no different than other services that a component might depend on.
99

10-
bUnit comes a tailor built mock of `IJSRuntime`, that allows you to specify how JavaScript interop calls should be handled, what values they should return, and to verify that they have happened.
10+
bUnit comes with a tailor built mock of `IJSRuntime`, that allows you to specify how JavaScript interop calls should be handled, what values they should return, and to verify that they have happened.
1111

1212
If you have more complex mocking needs, or you prefer to use the same mocking framework for all mocking in your tests to keep things consistent, general purpose mocking frameworks like [Moq](https://github.com/Moq), [JustMock Lite](https://github.com/telerik/JustMockLite), or [NSubstitute](https://nsubstitute.github.io/) all works nicely with bUnit.
1313

1414
The following sections shows how to use the built-in mock of `IJSRuntime`.
1515

1616
## Registering the mock `IJSRuntime`
1717

18-
A mock of `IJSRuntime` must be added to the `Services` collection, just like other services that a component under test requires. This is done like this:
18+
A mock of `IJSRuntime` must be added to the `Services` collection, just like other services that a component under test requires. This is done like so:
1919

2020
```csharp
2121
using var ctx = new TestContext();

0 commit comments

Comments
 (0)