Skip to content

Commit 14e5c3d

Browse files
committed
Renamed master branch to main
1 parent 499122c commit 14e5c3d

File tree

12 files changed

+39
-39
lines changed

12 files changed

+39
-39
lines changed

.github/workflows/CI-CD-Docs.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name: Build and Deploy Docs
33
on:
44
push:
55
branches:
6-
- master
6+
- main
77
paths-ignore:
88
- '!docs/**'
99
- '!.github/**'

.github/workflows/NUGET-PUSH.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,13 @@ name: NUGET-PUSH
33
on:
44
push:
55
branches:
6-
- master
6+
- main
77
paths:
88
- '.github/.force-nuget-push'
99

1010
env:
1111
VERSION: ''
12-
BRANCH: 'master'
12+
BRANCH: 'main'
1313

1414
jobs:
1515
build:

.github/workflows/RELEASE.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ on:
77

88
env:
99
VERSION: ''
10-
BRANCH: ''
10+
BRANCH: 'main'
1111

1212
jobs:
1313
build:

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
## Ignore Visual Studio temporary files, build results, and
22
## files generated by popular Visual Studio add-ons.
33
##
4-
## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore
4+
## Get latest from https://github.com/github/gitignore/blob/main/VisualStudio.gitignore
55

66
# User-specific files
77
*.suo

CHANGELOG.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -349,10 +349,10 @@ The latest version of the library is availble on NuGet:
349349

350350
- **Added logging to TestRenderer.** To make it easier to understand the rendering life-cycle during a test, the `TestRenderer` will now log when ever it dispatches an event or renders a component (the log statements can be access by capturing debug logs in the test results, as mentioned above).
351351

352-
- **Added some of the Blazor frameworks end-2-end tests.** To get better test coverage of the many rendering scenarios supported by Blazor, the [ComponentRenderingTest.cs](https://github.com/dotnet/aspnetcore/blob/master/src/Components/test/E2ETest/Tests/ComponentRenderingTest.cs) tests from the Blazor frameworks test suite has been converted from a Selenium to a bUnit. The testing style is very similar, so few changes was necessary to port the tests. The two test classes are here, if you want to compare:
352+
- **Added some of the Blazor frameworks end-2-end tests.** To get better test coverage of the many rendering scenarios supported by Blazor, the [ComponentRenderingTest.cs](https://github.com/dotnet/aspnetcore/blob/main/src/Components/test/E2ETest/Tests/ComponentRenderingTest.cs) tests from the Blazor frameworks test suite has been converted from a Selenium to a bUnit. The testing style is very similar, so few changes was necessary to port the tests. The two test classes are here, if you want to compare:
353353

354-
- [bUnit's ComponentRenderingTest.cs](/master/tests/BlazorE2E/ComponentRenderingTest.cs)
355-
- [Blazor's ComponentRenderingTest.cs](https://github.com/dotnet/aspnetcore/blob/master/src/Components/test/E2ETest/Tests/ComponentRenderingTest.cs)
354+
- [bUnit's ComponentRenderingTest.cs](/main/tests/BlazorE2E/ComponentRenderingTest.cs)
355+
- [Blazor's ComponentRenderingTest.cs](https://github.com/dotnet/aspnetcore/blob/main/src/Components/test/E2ETest/Tests/ComponentRenderingTest.cs)
356356

357357
### Changed
358358
- **Namespaces is now `Bunit`**

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ bUnit accept fixes and features! Here is what you should do when writing code fo
1515
- Follow the coding conventions used in the project. In general, they align with the AspNetCore teams [coding guidelines](https://github.com/dotnet/aspnetcore/wiki/Engineering-guidelines#coding-guidelines).
1616
- 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.
1717
- All code changes should be done on the `DEV` branch, and pull requests should target it.
18-
- All updates to the documentation, located under `./docs/` should be done on the `MASTER` 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.
18+
- 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.
1919
- Any code or documentation you share with the bUnit projects should fall under the projects license agreement.
2020

2121
Here are some resources to help you get started on how to contribute code or new content.

docs/site/docs/csharp-based-testing.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,4 +176,4 @@ See the page [Mocking JsRuntime](/docs/mocking-jsruntime.html) for more details
176176

177177
- [Semantic HTML markup comparison](/docs/semantic-html-markup-comparison.html)
178178
- [Mocking JsRuntime](/docs/mocking-jsruntime.html)
179-
- [C# test examples in the sample project](https://github.com/egil/bunit/tree/master/sample/tests/Tests)
179+
- [C# test examples in the sample project](https://github.com/egil/bunit/tree/main/sample/tests/Tests)

docs/site/docs/csharp-test-examples.md

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@
44
55
In the following examples, the terminology **component under test** (abbreviated CUT) is used to mean the component that is the target of the test. The examples below use the `Shouldly` assertion library as well. If you prefer not to use that just replace the assertions with the ones from your own favorite assertion library.
66

7-
All examples can be found in the [Tests](https://github.com/egil/razor-components-testing-library/tree/master/sample/tests/Tests) folder in the [Sample project](https://github.com/egil/razor-components-testing-library/tree/master/sample/).
7+
All examples can be found in the [Tests](https://github.com/egil/razor-components-testing-library/tree/main/sample/tests/Tests) folder in the [Sample project](https://github.com/egil/razor-components-testing-library/tree/main/sample/).
88

99
## Testing components without parameters
1010

11-
The following unit-tests verifies that the [Counter.razor](https://github.com/egil/razor-components-testing-library/tree/master/sample/src/Pages/Counter.razor) component behaves correctly. Here is the source for the Counter component:
11+
The following unit-tests verifies that the [Counter.razor](https://github.com/egil/razor-components-testing-library/tree/main/sample/src/Pages/Counter.razor) component behaves correctly. Here is the source for the Counter component:
1212

1313
```razor
1414
@page "/counter"
@@ -31,7 +31,7 @@ The following unit-tests verifies that the [Counter.razor](https://github.com/eg
3131
}
3232
```
3333

34-
The [CounterTest.cs](https://github.com/egil/razor-components-testing-library/tree/master/sample/tests/Tests/Pages/CounterTest.cs) looks like this:
34+
The [CounterTest.cs](https://github.com/egil/razor-components-testing-library/tree/main/sample/tests/Tests/Pages/CounterTest.cs) looks like this:
3535

3636
```csharp
3737
public class CounterTest : ComponentTestFixture
@@ -113,7 +113,7 @@ A few things worth noting about the tests above:
113113

114114
In the following tests we will pass regular parameters to a component under test, e.g. `[Parameter] public SomeType PropName { get; set; }` style properties, where `SomeType` **is not** a `RenderFragment` or a `EventCallback` type.
115115

116-
The component under test will be the [Aside.razor](https://github.com/egil/razor-components-testing-library/tree/master/sample/src/Components/Aside.razor) component, which looks like this:
116+
The component under test will be the [Aside.razor](https://github.com/egil/razor-components-testing-library/tree/main/sample/src/Components/Aside.razor) component, which looks like this:
117117

118118
```cshtml
119119
<aside @attributes="Attributes">
@@ -133,7 +133,7 @@ The component under test will be the [Aside.razor](https://github.com/egil/razor
133133
}
134134
```
135135

136-
The [AsideTest.cs](https://github.com/egil/razor-components-testing-library/tree/master/sample/tests/Tests/Components/AsideTest.cs) looks like this:
136+
The [AsideTest.cs](https://github.com/egil/razor-components-testing-library/tree/main/sample/tests/Tests/Components/AsideTest.cs) looks like this:
137137

138138
```csharp
139139
public class AsideTest : ComponentTestFixture
@@ -214,7 +214,7 @@ Some notes on `Test002` above:
214214

215215
## Testing components with child content
216216

217-
The [Aside.razor](https://github.com/egil/razor-components-testing-library/tree/master/sample/src/Components/Aside.razor) component listed in the previous section also has a `ChildContent` parameter, so lets add a few tests that passes markup and components to it through that.
217+
The [Aside.razor](https://github.com/egil/razor-components-testing-library/tree/main/sample/src/Components/Aside.razor) component listed in the previous section also has a `ChildContent` parameter, so lets add a few tests that passes markup and components to it through that.
218218

219219
```csharp
220220
public class AsideTest : ComponentTestFixture
@@ -283,7 +283,7 @@ public class AsideTest : ComponentTestFixture
283283

284284
## Testing components with `EventCallback` parameters
285285

286-
To show how to pass an `EventCallback` to a component under test, we will use the [ThemedButton.razor](https://github.com/egil/razor-components-testing-library/tree/master/sample/src/Components/ThemedButton.razor), which looks like this:
286+
To show how to pass an `EventCallback` to a component under test, we will use the [ThemedButton.razor](https://github.com/egil/razor-components-testing-library/tree/main/sample/src/Components/ThemedButton.razor), which looks like this:
287287

288288
```cshtml
289289
<button @onclick="HandleOnClick"
@@ -305,7 +305,7 @@ To show how to pass an `EventCallback` to a component under test, we will use th
305305
}
306306
```
307307

308-
The relevant part of [ThemedButtonTest.cs](https://github.com/egil/razor-components-testing-library/tree/master/sample/tests/Tests/Components/ThemedButtonTest.cs) looks like this:
308+
The relevant part of [ThemedButtonTest.cs](https://github.com/egil/razor-components-testing-library/tree/main/sample/tests/Tests/Components/ThemedButtonTest.cs) looks like this:
309309

310310
```csharp
311311
public class ThemedButtonTest : ComponentTestFixture
@@ -336,7 +336,7 @@ public class ThemedButtonTest : ComponentTestFixture
336336

337337
## Testing components with cascading-value parameters
338338

339-
If a component under test accepts cascading values, like [ThemedButton.razor](https://github.com/egil/razor-components-testing-library/tree/master/sample/src/Components/ThemedButton.razor) listed above, we can pass one or more cascading values to it like so:
339+
If a component under test accepts cascading values, like [ThemedButton.razor](https://github.com/egil/razor-components-testing-library/tree/main/sample/src/Components/ThemedButton.razor) listed above, we can pass one or more cascading values to it like so:
340340

341341
```csharp
342342
public class ThemedButtonTest : ComponentTestFixture
@@ -404,7 +404,7 @@ To make it easy to mock calls to JavaScript, the library comes with a `IJsRuntim
404404

405405
If you have more complex mocking needs, you could look to frameworks like [Moq](https://github.com/Moq) or [JustMock Lite](https://github.com/telerik/JustMockLite), which both work nicely with bUnit.
406406

407-
To help us test the Mock JSRuntime, we have the [WikiSearch.razor](https://github.com/egil/razor-components-testing-library/tree/master/sample/src/Components/WikiSearch.razor) component, which looks like this:
407+
To help us test the Mock JSRuntime, we have the [WikiSearch.razor](https://github.com/egil/razor-components-testing-library/tree/main/sample/src/Components/WikiSearch.razor) component, which looks like this:
408408

409409
```cshtml
410410
@inject IJSRuntime jsRuntime
@@ -432,7 +432,7 @@ To help us test the Mock JSRuntime, we have the [WikiSearch.razor](https://githu
432432
}
433433
```
434434

435-
The [WikiSearchTest.cs](https://github.com/egil/razor-components-testing-library/tree/master/sample/tests/Tests/Components/WikiSearchTest.cs) looks like this:
435+
The [WikiSearchTest.cs](https://github.com/egil/razor-components-testing-library/tree/main/sample/tests/Tests/Components/WikiSearchTest.cs) looks like this:
436436

437437
```csharp
438438
public class WikiSearchTest : ComponentTestFixture
@@ -499,7 +499,7 @@ public class WikiSearchTest : ComponentTestFixture
499499

500500
If you want to verify that a element reference (`ElementReference`) passed to a IJsRuntime.InvokeAsync call is references the expected DOM element, you can do so with the `ShouldBeElementReferenceTo()` assert helper.
501501

502-
For example, consider the [FocussingInput.razor](https://github.com/egil/razor-components-testing-library/tree/master/sample/src/Components/FocussingInput.razor) component, which looks like this:
502+
For example, consider the [FocussingInput.razor](https://github.com/egil/razor-components-testing-library/tree/main/sample/src/Components/FocussingInput.razor) component, which looks like this:
503503

504504
```cshtml
505505
@inject IJSRuntime jsRuntime
@@ -522,7 +522,7 @@ For example, consider the [FocussingInput.razor](https://github.com/egil/razor-c
522522
}
523523
```
524524

525-
The the [FocussingInputTest.cs](https://github.com/egil/razor-components-testing-library/tree/master/sample/tests/Tests/Components/FocussingInputTest.cs) looks like this:
525+
The the [FocussingInputTest.cs](https://github.com/egil/razor-components-testing-library/tree/main/sample/tests/Tests/Components/FocussingInputTest.cs) looks like this:
526526

527527
```csharp
528528
public class FocussingInputTest : ComponentTestFixture
@@ -552,15 +552,15 @@ The last line verifies that there was a single argument to the invocation, and v
552552

553553
## Testing components with injected dependencies
554554

555-
The demonstrate service injection, lets refactor the [FetchData.razor](https://github.com/egil/razor-components-testing-library/tree/master/sample/src/Pages/FetchData.razor) component that comes with the default Razor app template, to make it more testable:
555+
The demonstrate service injection, lets refactor the [FetchData.razor](https://github.com/egil/razor-components-testing-library/tree/main/sample/src/Pages/FetchData.razor) component that comes with the default Razor app template, to make it more testable:
556556

557-
- Extract an interface from [WeatherForecastService](https://github.com/egil/razor-components-testing-library/tree/master/sample/src/Data/WeatherForecastService.cs), name it [IWeatherForecastService](https://github.com/egil/razor-components-testing-library/tree/master/sample/src/Data/IWeatherForecastService.cs), and have `FetchData` take a dependency on it.
557+
- Extract an interface from [WeatherForecastService](https://github.com/egil/razor-components-testing-library/tree/main/sample/src/Data/WeatherForecastService.cs), name it [IWeatherForecastService](https://github.com/egil/razor-components-testing-library/tree/main/sample/src/Data/IWeatherForecastService.cs), and have `FetchData` take a dependency on it.
558558

559-
- Extract the `<table>` inside the `else` branch in the [FetchData.razor](https://github.com/egil/razor-components-testing-library/tree/master/sample/src/Pages/FetchData.razor) component into its own component. Lets name it [ForecastDataTable](https://github.com/egil/razor-components-testing-library/tree/master/sample/src/Pages/FetchData.razor).
559+
- Extract the `<table>` inside the `else` branch in the [FetchData.razor](https://github.com/egil/razor-components-testing-library/tree/main/sample/src/Pages/FetchData.razor) component into its own component. Lets name it [ForecastDataTable](https://github.com/egil/razor-components-testing-library/tree/main/sample/src/Pages/FetchData.razor).
560560

561-
- In the [FetchData.razor](https://github.com/egil/razor-components-testing-library/tree/master/sample/src/Pages/FetchData.razor), pass the variable `forecasts` to the [ForecastDataTable](https://github.com/egil/razor-components-testing-library/tree/master/sample/src/Pages/FetchData.razor) component.
561+
- In the [FetchData.razor](https://github.com/egil/razor-components-testing-library/tree/main/sample/src/Pages/FetchData.razor), pass the variable `forecasts` to the [ForecastDataTable](https://github.com/egil/razor-components-testing-library/tree/main/sample/src/Pages/FetchData.razor) component.
562562

563-
Now we just need a [MockForecastService.cs](https://github.com/egil/razor-components-testing-library/tree/master/sample/tests/MockForecastService.cs). It looks like this:
563+
Now we just need a [MockForecastService.cs](https://github.com/egil/razor-components-testing-library/tree/main/sample/tests/MockForecastService.cs). It looks like this:
564564

565565
```csharp
566566
internal class MockForecastService : IWeatherForecastService
@@ -570,7 +570,7 @@ internal class MockForecastService : IWeatherForecastService
570570
}
571571
```
572572

573-
With the mock in place, we can write the [FetchDataTest.cs](https://github.com/egil/razor-components-testing-library/tree/master/sample/tests/Tests/Pages/FetchDataTest.cs), which looks like this:
573+
With the mock in place, we can write the [FetchDataTest.cs](https://github.com/egil/razor-components-testing-library/tree/main/sample/tests/Tests/Pages/FetchDataTest.cs), which looks like this:
574574

575575
```csharp
576576
public class FetchDataTest : ComponentTestFixture

docs/site/docs/razor-based-testing.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,4 +125,4 @@ Since Blazor test component use xUnit under the hood as a test runner, you execu
125125

126126
- [Semantic HTML markup comparison](/docs/semantic-html-markup-comparison.html)
127127
- [Mocking JsRuntime](/docs/mocking-jsruntime.html)
128-
- [Razor based test examples in the sample project](https://github.com/egil/bunit/tree/master/sample/tests/RazorTestComponents)
128+
- [Razor based test examples in the sample project](https://github.com/egil/bunit/tree/main/sample/tests/RazorTestComponents)

docs/site/docs/razor-test-examples.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@
44
55
In the following examples, the terminology **component under test** (abbreviated CUT) is used to mean the component that is the target of the test. The examples below use the `Shouldly` assertion library as well. If you prefer not to use that just replace the assertions with the ones from your own favorite assertion library.
66

7-
All examples can be found in the [Tests](https://github.com/egil/bunit/tree/master/sample/tests/Tests) folder in the [Sample project](https://github.com/egil/bunit/tree/master/sample/).
7+
All examples can be found in the [Tests](https://github.com/egil/bunit/tree/main/sample/tests/Tests) folder in the [Sample project](https://github.com/egil/bunit/tree/main/sample/).
88

99
## Examples
1010

11-
Here is a few examples that demonstrate how Razor test components can be used. More can be found in the [sample/tests/RazorComponentTests](https://github.com/egil/bunit/tree/master/sample/tests/RazorComponentTests) samples folder.
11+
Here is a few examples that demonstrate how Razor test components can be used. More can be found in the [sample/tests/RazorComponentTests](https://github.com/egil/bunit/tree/main/sample/tests/RazorComponentTests) samples folder.
1212

1313
```cshtml
1414
<Fixture Test="ThemedButtonUsesNamedCascadingValue">
@@ -32,7 +32,7 @@ Here is a few examples that demonstrate how Razor test components can be used. M
3232
}
3333
```
3434

35-
This example shows how [ThemedElement.razor](https://github.com/egil/bunit/tree/master/sample/src/Components/ThemedElement.razor) can be tested with cascading values.
35+
This example shows how [ThemedElement.razor](https://github.com/egil/bunit/tree/main/sample/src/Components/ThemedElement.razor) can be tested with cascading values.
3636

3737
```cshtml
3838
<Fixture Test=MarkupPassedViaChildContent>
@@ -55,9 +55,9 @@ This example shows how [ThemedElement.razor](https://github.com/egil/bunit/tree/
5555
}
5656
```
5757

58-
This example shows how [ThemedButton.razor](https://github.com/egil/bunit/tree/master/sample/src/Components/ThemedButton.razor) can be tested with with child content, and how a `<Fragment>` can be used to specify the expected output.
58+
This example shows how [ThemedButton.razor](https://github.com/egil/bunit/tree/main/sample/src/Components/ThemedButton.razor) can be tested with with child content, and how a `<Fragment>` can be used to specify the expected output.
5959

60-
Lets look at a more complex example, a test of the [TodoList.razor](https://github.com/egil/bunit/tree/master/sample/src/Pages/TodoList.razor) component:
60+
Lets look at a more complex example, a test of the [TodoList.razor](https://github.com/egil/bunit/tree/main/sample/src/Pages/TodoList.razor) component:
6161

6262
```cshtml
6363
<Fixture Setup="() => Services.AddMockJsRuntime()"

0 commit comments

Comments
 (0)