Skip to content

Commit 291bcd8

Browse files
authored
Merge pull request #581 from bUnit-dev/release/v1.4
Release of new minor version v1.4
2 parents 10c8511 + f3de647 commit 291bcd8

File tree

316 files changed

+20251
-20350
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

316 files changed

+20251
-20350
lines changed

.editorconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -229,6 +229,7 @@ csharp_space_between_square_brackets = false
229229
# https://docs.microsoft.com/visualstudio/ide/editorconfig-formatting-conventions#wrap-options
230230
csharp_preserve_single_line_statements = false
231231
csharp_preserve_single_line_blocks = true
232+
csharp_style_namespace_declarations = file_scoped:warning
232233

233234
##########################################
234235
# .NET Naming Conventions

.github/workflows/verification.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,6 @@ jobs:
6565
run: |
6666
dotnet test ./tests/bunit.core.tests/bunit.core.tests.csproj -c release --logger GitHubActions --blame-hang --blame-hang-timeout 1m --blame-hang-dump-type none
6767
dotnet test ./tests/bunit.web.tests/bunit.web.tests.csproj -c release --logger GitHubActions --blame-hang --blame-hang-timeout 1m --blame-hang-dump-type none
68-
dotnet test ./tests/bunit.web.mock.tests/bunit.web.mock.tests.csproj -c release --logger GitHubActions --blame-hang --blame-hang-timeout 1m --blame-hang-dump-type none
6968
dotnet test ./tests/bunit.web.testcomponents.tests/bunit.web.testcomponents.tests.csproj -c release --logger GitHubActions --blame-hang --blame-hang-timeout 1m --blame-hang-dump-type none
7069
7170
- name: 🗳️ Pack library

CHANGELOG.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,19 @@ All notable changes to **bUnit** will be documented in this file. The project ad
66

77
## [Unreleased]
88

9+
This release reintroduces `Stub<TComponent>` and related back into the main library, so the "preview" library `bunit.web.mock` is already obsolete.
10+
11+
### Added
12+
13+
- Add `ComponentFactories` extensions method that makes it easy to register an instance of a replacement component. By [@egil](https://github.com/egil).
14+
- Add ability to pass `ServiceProviderOptions` to `TestServiceProvider` through property to allow users to customize the service provider. By [@rodolfograve](https://github.com/rodolfograve).
15+
16+
### Fixed
17+
18+
- Changed `SetParametersAndRender` such that it rethrows any exceptions thrown by the component under tests `SetParametersAsync` method. Thanks to [@bonsall](https://github.com/bonsall) for reporting the issue. Fixed by [@egil](https://github.com/egil).
19+
- `onclick` on a button inside a form will raise the `onsubmit` event for the form itself. Reported by [@egil]. Fixed by [@linkdotnet](https://github.com/linkdotnet).
20+
- Only forms are allowed to have a `onsubmit` event handler. When `onsubmit` is invoked from a non-form element results in an exception. Fixed by [@linkdotnet](https://github.com/linkdotnet).
21+
922
## [1.3.42] - 2021-11-09
1023

1124
This release includes support for .NET 6, with support for all new features in Blazor with that release. There are also a number of additions and fixes, all listed below.

Directory.Build.props

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
<PropertyGroup Label="Compile settings">
1919
<Nullable>enable</Nullable>
2020
<LangVersion>10.0</LangVersion>
21-
<ImplicitUsings>disable</ImplicitUsings>
21+
<ImplicitUsings>enable</ImplicitUsings>
2222
<NoWarn>CA1014,NU5104</NoWarn>
2323

2424
<!-- Used by code coverage -->
@@ -47,8 +47,17 @@
4747
<!-- Shared code analyzers used for all projects in the solution -->
4848
<ItemGroup Label="Code Analyzers">
4949
<PackageReference Include="AsyncFixer" Version="1.5.1" PrivateAssets="All" />
50-
<PackageReference Include="Meziantou.Analyzer" Version="1.0.675" PrivateAssets="All" />
51-
<PackageReference Include="SonarAnalyzer.CSharp" Version="8.30.0.37606" PrivateAssets="All" />
50+
<PackageReference Include="Meziantou.Analyzer" Version="1.0.681" PrivateAssets="All" />
51+
<PackageReference Include="SonarAnalyzer.CSharp" Version="8.33.0.40503" PrivateAssets="All" />
52+
</ItemGroup>
53+
54+
<ItemGroup Label="Implicit usings" Condition="$(MSBuildProjectName) != 'bunit.template' AND $(MSBuildProjectName) != 'bunit'">
55+
<Using Include="Microsoft.AspNetCore.Components" />
56+
<Using Include="Microsoft.AspNetCore.Components.RenderTree" />
57+
<Using Include="Microsoft.AspNetCore.Components.Rendering" />
58+
<Using Include="Microsoft.Extensions.DependencyInjection" />
59+
<Using Include="System.Runtime.Serialization" />
60+
<Using Include="System.Diagnostics.CodeAnalysis" />
5261
</ItemGroup>
5362

5463
<!-- https://github.com/dotnet/sdk/issues/18148#issuecomment-860957180 from @elion -->

bunit.sln

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -59,10 +59,6 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".workflows", ".workflows",
5959
.github\workflows\verification.yml = .github\workflows\verification.yml
6060
EndProjectSection
6161
EndProject
62-
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "bunit.web.mock", "src\bunit.web.mock\bunit.web.mock.csproj", "{3B51665F-E515-498A-8A82-BDB623089F9D}"
63-
EndProject
64-
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "bunit.web.mock.tests", "tests\bunit.web.mock.tests\bunit.web.mock.tests.csproj", "{050E57C2-C28F-4A9A-B35F-5725068AEF80}"
65-
EndProject
6662
Global
6763
GlobalSection(SolutionConfigurationPlatforms) = preSolution
6864
Debug|Any CPU = Debug|Any CPU
@@ -101,14 +97,6 @@ Global
10197
{4CAB561E-0AFF-4516-AB9B-981F94EF1E86}.Debug|Any CPU.Build.0 = Debug|Any CPU
10298
{4CAB561E-0AFF-4516-AB9B-981F94EF1E86}.Release|Any CPU.ActiveCfg = Release|Any CPU
10399
{4CAB561E-0AFF-4516-AB9B-981F94EF1E86}.Release|Any CPU.Build.0 = Release|Any CPU
104-
{3B51665F-E515-498A-8A82-BDB623089F9D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
105-
{3B51665F-E515-498A-8A82-BDB623089F9D}.Debug|Any CPU.Build.0 = Debug|Any CPU
106-
{3B51665F-E515-498A-8A82-BDB623089F9D}.Release|Any CPU.ActiveCfg = Release|Any CPU
107-
{3B51665F-E515-498A-8A82-BDB623089F9D}.Release|Any CPU.Build.0 = Release|Any CPU
108-
{050E57C2-C28F-4A9A-B35F-5725068AEF80}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
109-
{050E57C2-C28F-4A9A-B35F-5725068AEF80}.Debug|Any CPU.Build.0 = Debug|Any CPU
110-
{050E57C2-C28F-4A9A-B35F-5725068AEF80}.Release|Any CPU.ActiveCfg = Release|Any CPU
111-
{050E57C2-C28F-4A9A-B35F-5725068AEF80}.Release|Any CPU.Build.0 = Release|Any CPU
112100
EndGlobalSection
113101
GlobalSection(SolutionProperties) = preSolution
114102
HideSolutionNode = FALSE
@@ -123,8 +111,6 @@ Global
123111
{7972A80F-30DC-4EF4-9294-7D4DD2965882} = {6EA09ED4-B714-4E6F-B0E1-4D987F8AE520}
124112
{F61B8A55-3B5B-45FB-8E38-DBF9296B35C7} = {9A2B3B34-D41C-43E8-BC7D-246BEBE48D59}
125113
{4CAB561E-0AFF-4516-AB9B-981F94EF1E86} = {6EA09ED4-B714-4E6F-B0E1-4D987F8AE520}
126-
{3B51665F-E515-498A-8A82-BDB623089F9D} = {9A2B3B34-D41C-43E8-BC7D-246BEBE48D59}
127-
{050E57C2-C28F-4A9A-B35F-5725068AEF80} = {6EA09ED4-B714-4E6F-B0E1-4D987F8AE520}
128114
EndGlobalSection
129115
GlobalSection(ExtensibilityGlobals) = postSolution
130116
SolutionGuid = {24106918-1C86-4769-BDA6-9C80E64CD260}

docs/samples/.editorconfig

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
root = true
2+
3+
[*]
4+
indent_style = space
5+
tab_size = 2
6+
charset = utf-8
7+
trim_trailing_whitespace = true
8+
insert_final_newline = false
9+
10+
[*.md]
11+
trim_trailing_whitespace = false
12+
13+
[*.{cs,razor}]
14+
tab_size = 2
15+
indent_style = space
16+
dotnet_diagnostic.BL0001.severity = none
17+
dotnet_diagnostic.BL0002.severity = none
18+
dotnet_diagnostic.BL0003.severity = none
19+
dotnet_diagnostic.BL0004.severity = none
20+
dotnet_diagnostic.BL0005.severity = none
21+
dotnet_diagnostic.BL0006.severity = none
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<h1>Counter</h1>
2+
3+
<FancyParagraph Text=@($"Current count: {currentCount}") />
4+
5+
<button class="btn btn-primary" @onclick="IncrementCount">Click me</button>
6+
7+
@code {
8+
int currentCount = 0;
9+
10+
void IncrementCount()
11+
{
12+
currentCount++;
13+
}
14+
}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
<p>@Text</p>
2+
@code {
3+
[Parameter]
4+
public string Text { get; set; }
5+
}

docs/samples/components/bunit.docs.samples.csproj

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk.Razor">
22

33
<PropertyGroup>
4-
<TargetFrameworks>netstandard2.0;net5.0</TargetFrameworks>
4+
<TargetFrameworks>netstandard2.0;net5.0;net6.0</TargetFrameworks>
55
<RazorLangVersion>3.0</RazorLangVersion>
66
<RootNamespace>Bunit.Docs.Samples</RootNamespace>
77
</PropertyGroup>
@@ -22,4 +22,12 @@
2222
<PackageReference Include="Microsoft.AspNetCore.Components.Authorization" Version="5.0.0" />
2323
</ItemGroup>
2424

25+
<ItemGroup Condition="'$(TargetFramework)' == 'net6.0'">
26+
<PackageReference Include="Microsoft.Extensions.Logging" Version="6.0.0" />
27+
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="6.0.0" />
28+
<PackageReference Include="Microsoft.AspNetCore.Components" Version="6.0.0" />
29+
<PackageReference Include="Microsoft.AspNetCore.Components.Web" Version="6.0.0" />
30+
<PackageReference Include="Microsoft.AspNetCore.Components.Authorization" Version="6.0.0" />
31+
</ItemGroup>
32+
2533
</Project>
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
<Project>
22
<PropertyGroup>
3-
<TargetFrameworks>netcoreapp3.1;net5.0</TargetFrameworks>
3+
<TargetFrameworks>netcoreapp3.1;net5.0;net6.0</TargetFrameworks>
44
<IsPackable>false</IsPackable>
5-
<LangVersion>9.0</LangVersion>
5+
<LangVersion>10.0</LangVersion>
66
<RazorLangVersion>3.0</RazorLangVersion>
77
</PropertyGroup>
88
</Project>

0 commit comments

Comments
 (0)