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: CHANGELOG.md
+1Lines changed: 1 addition & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -50,6 +50,7 @@ List of fixes in this release.
50
50
### Changed
51
51
52
52
- Changed bunit.template such that created projects only reference the bUnit package. Bumped other referenced packages to latest version.
53
+
- Changed TestServiceProvider to validate scopes of registered services, such that it behaves like the service provider (default IoC container) in Blazor.
Copy file name to clipboardExpand all lines: tests/bunit.core.tests/TestServiceProviderTest.net5.cs
+38-8Lines changed: 38 additions & 8 deletions
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,5 @@
1
-
#if !NETCOREAPP3_1
1
+
#if NET5_0_OR_GREATER
2
2
usingSystem;
3
-
usingSystem.Diagnostics.CodeAnalysis;
4
3
usingSystem.Threading.Tasks;
5
4
usingMicrosoft.Extensions.DependencyInjection;
6
5
usingShouldly;
@@ -10,20 +9,51 @@ namespace Bunit
10
9
{
11
10
publicpartialclassTestServiceProviderTest
12
11
{
13
-
[Fact(DisplayName="Can correctly dispose of async disposable service")]
14
-
[SuppressMessage("Reliability","CA2000:Dispose objects before losing scope",Justification="Point of test is to verify explicit call to Dispose doesn't throw.")]
12
+
[Fact(DisplayName="Can correctly resolve and dispose of scoped disposable service")]
0 commit comments