You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: bunit.docs/docs/csharp-based-testing.md
+9-17Lines changed: 9 additions & 17 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,11 +2,11 @@
2
2
3
3
This pages documents how to do Blazor/Razor component testing using just C#.
4
4
5
-
Before you get started, make sure you have read the [Getting started](/docs/Getting-Started.html) page and in particular the [Basics of Blazor component testing](/docs/Basics-of-Blazor-component-testing.html) section. It wont take long, and it will ensure you get a good start at component testing.
5
+
Before you get started, make sure you have read the [Getting started](/docs/getting-started.html) page and in particular the [Basics of Blazor component testing](/docs/basics-of-blazor-component-testing.html) section. It wont take long, and it will ensure you get a good start at component testing.
6
6
7
7
> **NOTE:** You are currently required to write your tests using the xUnit framework. If popular demand requires it, this library can be made test framework independent in the future.
8
8
9
-
> **TIP:** Working with and asserting against the rendered component and its output is covered on the [Working with rendered components and fragments](/docs/Working-with-rendered-components-and-fragments.html) page.
9
+
> **TIP:** Working with and asserting against the rendered component and its output is covered on the [Working with rendered components and fragments](/docs/working-with-rendered-components-and-fragments.html) page.
10
10
11
11
**Content:**
12
12
@@ -18,10 +18,10 @@ Before you get started, make sure you have read the [Getting started](/docs/Gett
18
18
19
19
**Further reading:**
20
20
21
-
-[Working with rendered components and fragments](/docs/Working-with-rendered-components-and-fragments.html)
22
-
-[Semantic HTML markup comparison](/docs/Semantic-HTML-markup-comparison.html)
-[C# test examples](/docs/csharp-test-examples.html)
25
25
26
26
## Creating an new test class
27
27
@@ -71,7 +71,7 @@ The `RenderComponent<TComponent>(params ComponentParameter[] parameters) : IRend
71
71
72
72
-`TComponent` is the type of component you want to render.
73
73
-`ComponentParameter[] parameters` represents parameters that will be passed to the component during render.
74
-
-`IRenderedComponent<TComponent>` is the representation of the rendered component. Working with the rendered component and its output is covered on the [Working with rendered components and fragments](/docs/Working-with-rendered-components-and-fragments.html) page.
74
+
-`IRenderedComponent<TComponent>` is the representation of the rendered component. Working with the rendered component and its output is covered on the [Working with rendered components and fragments](/docs/working-with-rendered-components-and-fragments.html) page.
75
75
76
76
### Passing parameters to components during render
77
77
@@ -166,7 +166,7 @@ This is done via the `ITestContext.Services` property. Once a component has been
166
166
167
167
If for example we want to render the with a dependency on an `IMyService`, we first have to call one of the `AddSingleton` methods on the service collection and register it. All the normal `AddSingleton``ServiceCollection` overloads are available.
168
168
169
-
In the case if a `IJsRuntime` dependency, we can however use the built-in [Mocking JsRuntime](/docs/Mocking-JsRuntime.html). For example:
169
+
In the case if a `IJsRuntime` dependency, we can however use the built-in [Mocking JsRuntime](/docs/mocking-jsruntime.html). For example:
170
170
171
171
```csharp
172
172
publicclassComponentTest : ComponentTestFixture// implements the ITestContext interface
@@ -187,12 +187,4 @@ public class ComponentTest : ComponentTestFixture // implements the ITestContext
187
187
}
188
188
```
189
189
190
-
See the page [Mocking JsRuntime](/docs/Mocking-JsRuntime.html) for more details mock.
191
-
192
-
## Further reading
193
-
194
-
To learn how to work with and assert against `IRenderedComponent`s visit the related pages:
195
-
196
-
-[Working with rendered components and fragments](/docs/Working-with-rendered-components-and-fragments.html)
197
-
-[Semantic HTML markup comparison](/docs/Semantic-HTML-markup-comparison.html)
Copy file name to clipboardExpand all lines: bunit.docs/docs/razor-based-testing.md
+8-8Lines changed: 8 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,14 +2,14 @@
2
2
3
3
This pages documents how to do Blazor/Razor component testing from `.razor` files.
4
4
5
-
Before you get started, make sure you have read the [Getting started](/docs/Getting-Started.html) page and in particular the [Basics of Blazor component testing](/docs/Basics-of-Blazor-component-testing.html) section. It wont take long, and it will ensure you get a good start at component testing.
5
+
Before you get started, make sure you have read the [Getting started](/docs/getting-started.html) page and in particular the [Basics of Blazor component testing](/docs/basics-of-blazor-component-testing.html) section. It wont take long, and it will ensure you get a good start at component testing.
6
6
7
7
> **NOTE:** This feature is _EXPERIMENTAL_ and syntax and API will likely changed. Here are a few limitations to be aware of at the moment:
8
8
>
9
9
> - The xUnit test runner can detect and execute tests in Razor test components, but is not able to distinguish the individual `<Fixture>`'s from each other. They are all executed together, one at the time. The solution is planned, see the [related issue](https://github.com/egil/razor-components-testing-library/issues/4) for details.
10
-
> - Go to the [Contribute](https://github.com/egil/razor-components-testing-library/wiki/Contribute) page for info on how to provide feedback and suggestions.
10
+
> - Go to the [Contribute](/docs/contribute) page for info on how to provide feedback and suggestions.
11
11
12
-
> **TIP:** Working with and asserting against the rendered component and its output is covered on the [Working with rendered components and fragments](/docs/Working-with-rendered-components-and-fragments.html) page.
12
+
> **TIP:** Working with and asserting against the rendered component and its output is covered on the [Working with rendered components and fragments](/docs/working-with-rendered-components-and-fragments.html) page.
13
13
14
14
**Content:**
15
15
@@ -19,10 +19,10 @@ Before you get started, make sure you have read the [Getting started](/docs/Gett
19
19
20
20
**Further reading:**
21
21
22
-
-[Working with rendered components and fragments](/docs/Working-with-rendered-components-and-fragments.html)
23
-
-[Semantic HTML markup comparison](/docs/Semantic-HTML-markup-comparison.html)
-[Razor test examples](/docs/razor-test-examples.html)
26
26
27
27
## Creating a new Razor test component
28
28
@@ -56,7 +56,7 @@ You will also need to import a few namespaces to make asserting and mocking poss
56
56
@using Xunit
57
57
```
58
58
59
-
> **NOTE:** The `_Imports.razor` has already been created for you if you are using the [Blazor test project template](/docs/Creating-a-new-test-project.html).
59
+
> **NOTE:** The `_Imports.razor` has already been created for you if you are using the [Blazor test project template](/docs/creating-a-new-test-project.html).
0 commit comments