Skip to content

Commit 78e4c82

Browse files
authored
Editorial review and changes from Packt
2 parents 5f74ff6 + a0c6b1b commit 78e4c82

32 files changed

Lines changed: 290 additions & 275 deletions

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -336,3 +336,5 @@ bunit.docs/log.txt
336336
*coverage*.info
337337
.sonarqube
338338
tests/*/coverage
339+
340+
bunit.v3.ncrunchsolution.user

docs/README.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,16 @@ Here is a small getting started guide for contributing to the documentation...
99
1. The `site` folder contains the code for generating the documentation site, _and_ the documentation in markdown files, located in `site/docs`.
1010
2. The `samples` folder projects for the sample code that is displayed in the documentation. It has the following projects:
1111
- `samples/components`: A Blazor component library project where components under test are placed.
12-
- `samples/tests/mstest`: A MSTest project where MSTest test samples are placed.
13-
- `samples/tests/nunit`: A NUnit project where NUnit test samples are placed.
14-
- `samples/tests/razor`: A xUnit based test project where razor test samples are placed.
15-
- `samples/tests/xunit`: A xUnit project where xUnit C# only test samples are placed.
12+
- `samples/tests/mstest`: An MSTest project where MSTest test samples are placed.
13+
- `samples/tests/nunit`: An NUnit project where NUnit test samples are placed.
14+
- `samples/tests/razor`: An xUnit-based test project where razor test samples are placed.
15+
- `samples/tests/xunit`: An xUnit project where xUnit C#-only test samples are placed.
1616

17-
These sample components source files and tests source files are included in the documentation using [DocFx's Code Snippet syntax](https://dotnet.github.io/docfx/spec/docfx_flavored_markdown.html?tabs=tabid-1%2Ctabid-a#code-snippet). They are created as real projects, making them runnable, which helps ensure that the code shown in the documentation pages are correct and in working order.
17+
These sample components, source files, and tests source files are included in the documentation using [DocFx's Code Snippet syntax](https://dotnet.github.io/docfx/spec/docfx_flavored_markdown.html?tabs=tabid-1%2Ctabid-a#code-snippet). They are created as real projects, making them runnable, which helps ensure that the code samples shown in the documentation pages are correct and in working order.
1818

1919
## Building and Viewing Docs Locally
2020

21-
To build and view the documentation locally, following a few steps is required:
21+
To build and view the documentation locally, follow these steps:
2222

2323
1. From `docs/site` run `dotnet build`. If you get warnings from running `dotnet build`, try running it again.
2424
2. From `docs/` run `serve-docs.cmd`. This will start up a local web server, hosting the generated documentation site on http://localhost:8080, using the [`dotnet serve` tool](https://github.com/natemcmaster/dotnet-serve).
@@ -29,4 +29,4 @@ To build and view the documentation locally, following a few steps is required:
2929
- All pages should have a [YAML header](https://dotnet.github.io/docfx/spec/docfx_flavored_markdown.html#yaml-header) with a `UID` to make it easy to [cross reference](https://dotnet.github.io/docfx/spec/docfx_flavored_markdown.html#cross-reference) between pages
3030
- All page and code references should be created using the [`xref:UID` cross reference syntax](https://dotnet.github.io/docfx/tutorial/links_and_cross_references.html#using-cross-reference).
3131
- By default, you should include code snippets as sample files in the `samples` projects, using the [code snippet syntax](https://dotnet.github.io/docfx/spec/docfx_flavored_markdown.html#code-snippet).
32-
- All code snippets should use 2 spaces as an indention unit (1 tab = 2 spaces).
32+
- All code snippets should use 2 spaces as an indention unit (1 tab = 2 spaces).
File renamed without changes.

docs/samples/tests/xunit/ReRenderTest.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ public void RendersViaInvokeAsync()
4747
{
4848
// Arrange - renders the Heading component
4949
using var ctx = new TestContext();
50-
var cut = ctx.RenderComponent<ImparativeCalc>();
50+
var cut = ctx.RenderComponent<Calc>();
5151

5252
// Indirectly re-renders through the call to StateHasChanged
5353
// in the Calculate(x, y) method.

docs/site/docs.csproj

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,14 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<TargetFramework>netcoreapp3.1</TargetFramework>
4+
<TargetFramework>net5.0</TargetFramework>
55
</PropertyGroup>
66

77
<ItemGroup>
8-
<PackageReference Include="docfx.console" Version="2.56.2" PrivateAssets="All" />
8+
<PackageReference Include="docfx.console" Version="2.56.6">
9+
<PrivateAssets>all</PrivateAssets>
10+
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
11+
</PackageReference>
912
</ItemGroup>
1013

1114
</Project>

docs/site/docs/code-of-conduct.md

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ title: Contributor Covenant Code of Conduct
77

88
## Our Pledge
99

10-
In the interest of fostering an open and welcoming environment, we as
10+
In the interests of fostering an open and welcoming environment, we as
1111
contributors and maintainers pledge to make our project and
1212
community a harassment-free experience for everyone, regardless of age,
1313
size, disability, ethnicity, sexuality, gender identity and expression,
@@ -27,8 +27,7 @@ include:
2727

2828
Examples of unacceptable behavior by participants include:
2929

30-
* The use of sexualized language or imagery and unwelcome sexual attention or
31-
advances
30+
* The use of sexualized language or imagery and unwelcome sexual attention or advances
3231
* Trolling, insulting/derogatory comments, and personal or political attacks
3332
* Public or private harassment
3433
* Publishing others' private information, such as a physical or electronic
@@ -44,9 +43,8 @@ response to any instances of unacceptable behavior.
4443

4544
Project maintainers have the right and responsibility to remove, edit, or
4645
reject comments, commits, code, wiki edits, issues, and other contributions
47-
that are not aligned to this Code of Conduct, or to temporarily or
48-
permanently ban any contributor for other behaviors that they deem inappropriate,
49-
threatening, offensive, or harmful.
46+
that are not aligned with this Code of Conduct, or to temporarily or
47+
permanently ban any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful.
5048

5149
## Scope
5250

docs/site/docs/contribute.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ One of the easiest ways to contribute is to participate in discussions on GitHub
1010
## General Feedback and Discussions
1111
Start a discussion on the [bUnit discussion list](https://github.com/egil/bUnit/discussions).
1212

13-
## Bugs and feature requests
13+
## Bugs and Feature Requests
1414
For bugs or feature requests, log a new issue on the [issues list](https://github.com/egil/bunit/issues). Be sure to use the right template.
1515

1616
## Contributing Code and Content
@@ -21,7 +21,7 @@ bUnit accepts fixes and features. Here is what you should do when writing code f
2121
- Add, remove, or delete unit tests to cover your changes. Make sure tests are specific to the changes you are making. Tests need to be provided for every bug/feature that is completed.
2222
- All code changes should be done on the `DEV` branch, and pull requests should target it.
2323
- All updates to the documentation located under `./docs/` should be done on the `main` branch **if** they are general in nature and not tied to a specific version. Changes to the documentation related to changes on the `DEV` branch should be submitted to the `DEV` branch.
24-
- Any code or documentation you share with the bUnit projects should fall under the projects license agreement.
24+
- Any code or documentation you share with the bUnit projects should fall under the project's license agreement.
2525

2626
Here are some resources to help you get started on how to contribute code or new content:
2727

@@ -42,4 +42,4 @@ If you don't know what a pull request is, read this article: https://help.github
4242

4343
## Code of Conduct
4444

45-
See <xref:code-of-conduct>
45+
See <xref:code-of-conduct>

docs/site/docs/external-resources.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ Here is a list of some web content that covers bUnit. If you produce something y
1111
- **[Testing Blazor Components - session from .NET Conf - Focus on Blazor](https://youtu.be/5d-uIxx1cUE)**
1212
Content is based on beta-5.1 of bUnit.
1313

14-
### PodCasts/Twitch/YouTube/Live coding
14+
### Podcasts/Twitch/YouTube/Live coding
1515

1616
- **[.NET Rocks! - Testing Blazor Apps with Egil Hansen](https://www.dotnetrocks.com/?show=1690)**
1717
Content is based on beta-7 of bUnit.

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

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ To use bUnit with xUnit, the easiest approach is to use the bUnit project templa
1111

1212
## Creating a Test Project Manually
1313

14-
This section will take you through the steps required to create a project for testing Blazor components using bUnit. Any of the three general purpose test frameworks shown in step 1 below can be used. Briefly, here is what we will do:
14+
This section will take you through the steps required to create a project for testing Blazor components using bUnit. Any of the three general-purpose test frameworks shown in step 1 below can be used. Briefly, here is what we will do:
1515

1616
1. Create a new xUnit/NUnit/MSTest testing project
1717
2. Add bUnit to the test project
@@ -22,7 +22,7 @@ Let's look at these in more detail. These steps look like this from the 'dotnet'
2222

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

25-
Use the following command (_click on the tab that for the test framework of choice_):
25+
Use the following command (_click on the tab for the test framework of choice_):
2626

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

@@ -98,7 +98,7 @@ To do so, change the first part of the test projects `.csproj` file to look like
9898

9999
**4. Add the test project to your solution**
100100

101-
If using Visual Studio, add the test project to your solution (`.sln`), and add a reference between the test project and project containing the components that are to be tested:
101+
If using Visual Studio, add the test project to your solution (`.sln`), and add a reference between the test project and the project containing the components that are to be tested:
102102

103103
```dotnetcli
104104
dotnet sln <NAME OF PROJECT>.sln add <NAME OF TEST PROJECT>
@@ -211,9 +211,10 @@ dotnet new bunit -o <NAME OF TEST PROJECT>
211211
```
212212

213213
The `-o` option in the `dotnet new` command above is used to specify the name of the test project.
214+
214215
**3. Add the test project to your solution**
215216

216-
If using Visual Studio, add the test project to your solution (`.sln`), and add a reference between the test project and project containing the components that should be tested:
217+
If using Visual Studio, add the test project to your solution (`.sln`), and add a reference between the test project and the project containing the components that should be tested:
217218

218219
```dotnetcli
219220
dotnet sln <NAME OF PROJECT>.sln add <NAME OF TEST PROJECT>

0 commit comments

Comments
 (0)