Skip to content

Commit 4da365c

Browse files
committed
spelling and api ref fix
1 parent 7e1115f commit 4da365c

4 files changed

Lines changed: 21 additions & 21 deletions

File tree

docs/docs/getting-started/create-test-project.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@ title: Creating a new bUnit Test Project
55

66
# Creating a new bUnit Test Project
77

8-
Before you can write any tests, you need a place to put them - a test project. bUnit is not a unit test runner, so you need a general purpose test framework, like xUnit, NUnit, or MSTest, in addition to bUnit, to run your tests, and write your assertions.
8+
Before you can write any tests, you need a place to put them - a test project. bUnit is not a unit test runner, so you need a general-purpose test framework, like xUnit, NUnit, or MSTest, in addition to bUnit, to run your tests, and write your assertions.
99

10-
If you prefer xUnit, you can use the bUnit project template approached described in the [Create a test project with bUnit template](#create-a-test-project-with-bunit-template) section further down the page. If you want to use another general purpose testing framework, read the following section.
10+
If you prefer xUnit, you can use the bUnit project template approached described in the [Create a test project with bUnit template](#create-a-test-project-with-bunit-template) section further down the page. If you want to use another general-purpose testing framework, read the following section.
1111

1212
## Create a Test Project Manually
1313

@@ -22,7 +22,7 @@ These steps look like this from the `dotnet` CLI:
2222

2323
**1. Create a new test project**
2424

25-
Use the following command (click on the tab that for the test framework you would like to use):
25+
Use the following command (_click on the tab that for the test framework you would like to use_):
2626

2727
# [xUnit](#tab/xunit)
2828

@@ -78,7 +78,7 @@ dotnet add package bunit.web --version #{VERSION}#
7878

7979
Then you need to change a few project settings, in particular we need to change the project's SDK to `Microsoft.NET.Sdk.Razor`, remember to set `RazorLangVersion` to `3.0`, and set the `<TargetFramework>` to `netcoreapp3.1`, since bUnit builds on `.netstandard 2.1`.
8080

81-
To do so, change the first part of the test project's `.csproj` file to look like this.:
81+
To do so, change the first part of the test projects `.csproj` file to look like this.:
8282

8383
```xml
8484
<Project Sdk="Microsoft.NET.Sdk.Razor">
@@ -102,7 +102,7 @@ dotnet sln <NAME OF PROJECT>.sln add <NAME OF TEST PROJECT>
102102
dotnet add <NAME OF COMPONENT PROJECT>.csproj reference <NAME OF TEST PROJECT>.csproj
103103
```
104104

105-
The end result should be a test project with a `.csproj` that looks like this (other packages than bUnit might have different version numbers):
105+
The result should be a test project with a `.csproj` that looks like this (other packages than bUnit might have different version numbers):
106106

107107

108108
# [xUnit](#tab/xunit)
@@ -185,7 +185,7 @@ The end result should be a test project with a `.csproj` that looks like this (o
185185

186186
## Create a Test Project with bUnit Template
187187

188-
If you want to skip a few steps in the guide above, you can use the [bUnit test project template](https://www.nuget.org/packages/bunit.template/). The bUNit project template is only available for using with xUnit as the general purpose testing framework, but that will change in the future.
188+
If you want to skip a few steps in the guide above, you can use the [bUnit test project template](https://www.nuget.org/packages/bunit.template/). The bUnit project template is only available for using with xUnit as the general-purpose testing framework, but that will change in the future.
189189

190190
The steps are as follows:
191191

@@ -225,6 +225,6 @@ dotnet add <NAME OF COMPONENT PROJECT>.csproj reference <NAME OF TEST PROJECT>.c
225225

226226
## Further Reading
227227

228-
Now you are ready to write some times. To learn how, continue reading the <xref:writing-csharp-tests> and <xref:writing-razor-tests> pages.
228+
Now you are ready to write some tests. To learn how, continue reading the <xref:writing-csharp-tests> and <xref:writing-razor-tests> pages.
229229

230230
For addition tips and tricks that will make writing tests easier, see the <xref:misc-test-tips> page.

docs/docs/getting-started/fixture-options.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,25 +5,25 @@ title: Fixture options in Razor Tests
55

66
# `<Fixture>` options in Razor Tests
77

8-
bUnit's <xref:Bunit.Fixture> component provides different parameters you can set on it, that changes the behavior of the test. It also allow you to both set up a component under test, and additional fragments, that can be used in the test.
8+
bUnit's <xref:Bunit.Fixture> component provides different parameters you can set on it, that changes the behavior of the test. It also allows you to both set up a component under test, and additional fragments, that can be used in the test.
99

1010

1111
## Parameters
1212

13-
All the parameters the `<Fixture>` support are shown in the listen below:
13+
All the parameters the `<Fixture>` support is shown in the listing below:
1414

1515
[!code-html[](../../samples/tests/razor/AllFixtureParameters.razor)]
1616

1717
**Setup and Test methods:**
1818

19-
Let's start by looking at the parameters that takes a method as input first. The methods are called in the order they are listed in below, if provided, and should be used to the following:
19+
Let us start by looking at the parameters that takes a method as input first. The methods are called in the order they are listed in below, if provided, and should be used to the following:
2020

2121
1. **<xref:Bunit.RazorTesting.FixtureBase`1.Setup>** and **<xref:Bunit.RazorTesting.FixtureBase`1.SetupAsync>:**
2222
The `Setup` and `SetupAsync` method is called first, and you can provide both if needed. If both are provided, `Setup` is called first.
2323
They allows you to configures e.g. the <xref:Bunit.ITestContext.Services> collection of the <xref:Bunit.Fixture> component before the component under test or any fragments are rendered.
2424
2. **<xref:Bunit.RazorTesting.FixtureBase`1.Test>** or **<xref:Bunit.RazorTesting.FixtureBase`1.TestAsync>:**
2525
The `Test` or `TestAsync` methods are called after the setup methods.
26-
_One, and only one,_ of the test methods must be specified. Use the test method to access the component under test and any fragments defined in the fixture, and interact and assert against them.
26+
_One, and only one,_ of the test methods must be specified. Use the test method to access the component under test and any fragments defined in the fixture and interact and assert against them.
2727

2828
**Other parameters**
2929

docs/docs/getting-started/writing-csharp-tests.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,15 @@ title: Writing Tests in C# for Blazor Components
55

66
# Writing Tests in C# for Blazor Components
77

8-
Testing Blazor components is a different from testing regular C# classes: Blazor components are *rendered*, they have the *Blazor component life-cycle*, during which we can *provide input* to them and where they *produce output*.
8+
Testing Blazor components is a different from testing regular C# classes: Blazor components are *rendered*, they have the *Blazor component life cycle*, during which we can *provide input* to them and where they *produce output*.
99

1010
**bUnit** enables you to render the component you want to test, pass in parameters to it, inject services into it, and access the rendered component instance and the markup it has produced.
1111

1212
Rendering a component happens through bUnit's <xref:Bunit.TestContext>, and the result of the rendering, a <xref:Bunit.IRenderedComponent`1>, provides access to the component instance, and the markup produced by the component.
1313

1414
## Creating a Basic Test
1515

16-
Lets see a simple example, where we test the following `<HelloWorld>` component:
16+
Let us see a simple example, where we test the following `<HelloWorld>` component:
1717

1818
[!code-html[HelloWorld.razor](../../samples/components/HelloWorld.razor)]
1919

docs/docs/getting-started/writing-razor-tests.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ title: Writing Tests in Razor Syntax for Blazor Components
88
> [!WARNING]
99
> Razor tests are currently only compatible with using xUnit as the general purpose testing framework.
1010
11-
A test for a Blazor component can be written in a Blazor component, using a mix of Razor and C# syntax. The advantage of this is the familiarity in declaring the component under test, and other HTML or Razor fragments that will be used in the test, in Razor and HTML markup. This is especially useful when testing components that takes a lot of parameters and child content as input.
11+
A test for a Blazor component can be written in a Blazor component, using a mix of Razor and C# syntax. The advantage of this is the familiarity in declaring the component under test, and other HTML or Razor fragments that will be used in the test, _in Razor and HTML markup_. This is especially useful when testing components that takes a lot of parameters and child content as input.
1212

1313
> [!INFO]
1414
> Tests declared inside Blazor test components can be discovered and invoked individually, and will show up in e.g. Visual Studio's Test Explorer.
@@ -17,15 +17,15 @@ A test for a Blazor component can be written in a Blazor component, using a mix
1717
1818
## Create a Test Specific `_Imports.razor` File
1919

20-
Razor tests are written in Blazor test components. To make our life's a little easier, let's first set up a `_Imports.razor` file, with the using statements we are going to be using throughout our tests. Simply add the following `_Imports.razor` to the root folder where you will be placing your Blazor test components:
20+
Razor tests are written in Blazor test components. To make our life's a little easier, let us first set up a `_Imports.razor` file, with the using statements we are going to be using throughout our tests. Simply add the following `_Imports.razor` to the root folder where you will be placing your Blazor test components:
2121

2222
[!code-html[_Imports.razor](../../samples/tests/razor/_Imports.razor#L3-)]
2323

2424
With that created, we are ready to create our first Razor test.
2525

2626
## Creating a Blazor Test Component
2727

28-
A Blazor test component is conceptually very similar to a regular test class in e.g. xUnit or NUnit. You can define multiple tests inside a single test component, but those has to based on the special bUnit test components, currently either <xref:Bunit.Fixture> or <xref:Bunit.SnapshotTest>.
28+
A Blazor test component is conceptually very similar to a regular test class in e.g. xUnit or NUnit. You can define multiple tests inside a single test component, as long as they are based on the special bUnit test components, currently either <xref:Bunit.Fixture> or <xref:Bunit.SnapshotTest>.
2929

3030
Besides that, Blazor test components has to inherit from <xref:Bunit.TestComponentBase>, e.g.:
3131

@@ -35,7 +35,7 @@ The following two sections will show how to create tests using bUnit's <xref:Bun
3535

3636
### Creating a Test using the `<Fixture>` Component
3737

38-
Lets see a simple example, where we test the following `<HelloWorld>` component using the bUnit <xref:Bunit.Fixture> component:
38+
Let's see a simple example, where we test the following `<HelloWorld>` component using the bUnit <xref:Bunit.Fixture> component:
3939

4040
[!code-html[HelloWorld.razor](../../samples/components/HelloWorld.razor)]
4141

@@ -51,7 +51,7 @@ Let's break down what is going on in this test:
5151
- The <xref:Bunit.Fixture> component's `Test` parameter takes a method, which is called when the test runs, and is passed the <xref:Bunit.Fixture> component.
5252
- In the test method, we:
5353
- Use the <xref:Bunit.Fixture.GetComponentUnderTest``1> to get the `HelloWorld` declared in the <xref:Bunit.Fixture>.
54-
- Verify the rendered markup from the `HelloWorld` component using the <xref:Bunit.MarkupMatchesAssertExtensions.MarkupMatches(Bunit.IRenderedFragment,System.String,System.String)> method, which performs a semantic comparison of the expected markup with the rendered markup.
54+
- Verify the rendered markup from the `HelloWorld` component using the <xref:Bunit.MarkupMatchesAssertExtensions.MarkupMatches> method, which performs a semantic comparison of the expected markup with the rendered markup.
5555

5656
> [!TIP]
5757
> Learn more about how the semantic HTML/markup comparison in bUnit work, and how to customize it on the <xref:semantic-html-comparison> page.
@@ -63,7 +63,7 @@ Let's break down what is going on in this test:
6363

6464
In snapshot testing, you declare your input (e.g. one or more component under test) and the expected output, and the library will automatically tell you if they do not match. With bUnit, this comparison is done using a smart built-in semantic HTML comparison logic.
6565

66-
Lets see a simple example, where we test the following `<HelloWorld>` component using the bUnit <xref:Bunit.SnapshotTest> component:
66+
Let's see a simple example, where we test the following `<HelloWorld>` component using the bUnit <xref:Bunit.SnapshotTest> component:
6767

6868
[!code-html[HelloWorld.razor](../../samples/components/HelloWorld.razor)]
6969

@@ -84,7 +84,7 @@ When the test runs, the <xref:Bunit.SnapshotTest> component will automatically c
8484
8585
### Passing Parameters to Components Under Test
8686

87-
Since we are declaring our component under test in Razor syntax, passing parameters to the component under test is exactly the same as passing parameters in normal Blazor components. This is the same for tests created with both the <xref:Bunit.Fixture> and <xref:Bunit.SnapshotTest> components.
87+
Since we are declaring our component under test in Razor syntax, passing parameters to the component under test is the same as passing parameters in normal Blazor components. This is the same for tests created with both the <xref:Bunit.Fixture> and <xref:Bunit.SnapshotTest> components.
8888

8989
In this example, we are passing both attribute parameters and child content to the component under test, in this case, a basic `<Alert>` component:
9090

@@ -94,7 +94,7 @@ Injecting services into the components under test is covered on the <xref:inject
9494

9595
## Further Reading
9696

97-
Now that we've covered the basics of writing tests using Razor syntax, you can continue digging deeper, e.g. by looking at:
97+
Now that we have covered the basics of writing tests using Razor syntax, you can continue digging deeper, e.g. by looking at:
9898

9999
- <xref:fixture-options>
100100
- <xref:snapshot-options>

0 commit comments

Comments
 (0)