Skip to content

Commit 75ad970

Browse files
committed
Version/Release notes set
Upgrades according to SimpleInjector 5 changes
1 parent 1234eb9 commit 75ad970

File tree

3 files changed

+18
-22
lines changed

3 files changed

+18
-22
lines changed

src/Simplify.DI.Provider.SimpleInjector.Tests/SimpleInjectorDIContainerProviderTests.cs

Lines changed: 13 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -453,7 +453,7 @@ public void ScopedResolve_ScopedDependsOnTransient_ActivationException()
453453
// Act && Assert
454454

455455
var ex = Assert.Throws<ActivationException>(() => scope.Resolver.Resolve<IFoo>());
456-
Assert.That(ex.Message, Does.StartWith("A lifestyle mismatch has been detected. Foo (Async Scoped) depends on IBar implemented by Bar (Transient)."));
456+
Assert.That(ex.Message, Does.Contain("[Lifestyle Mismatch] Foo (Async Scoped) depends on IBar implemented by Bar (Transient)"));
457457
}
458458
}
459459

@@ -561,14 +561,13 @@ public void ScopedResolve_SingletonDependsOnScoped_ActivationException()
561561
_provider.Register<IBar, Bar>();
562562
_provider.Register<IFoo, Foo>(LifetimeType.Singleton);
563563

564-
using (var scope = _provider.BeginLifetimeScope())
565-
{
566-
// Act && Assert
564+
using var scope = _provider.BeginLifetimeScope();
567565

568-
var ex = Assert.Throws<ActivationException>(() => scope.Resolver.Resolve<IFoo>());
569-
Assert.That(ex.Message,
570-
Does.StartWith("A lifestyle mismatch has been detected. Foo (Singleton) depends on IBar implemented by Bar (Async Scoped)."));
571-
}
566+
// Act && Assert
567+
568+
var ex = Assert.Throws<ActivationException>(() => scope.Resolver.Resolve<IFoo>());
569+
Assert.That(ex.Message,
570+
Does.Contain("[Lifestyle Mismatch] Foo (Singleton) depends on IBar implemented by Bar (Async Scoped)."));
572571
}
573572

574573
// Note: this behavior check is not available
@@ -625,14 +624,13 @@ public void ScopedResolve_SingletonDependsOnTransient_ActivationException()
625624
_provider.Register<IBar, Bar>(LifetimeType.Transient);
626625
_provider.Register<IFoo, Foo>(LifetimeType.Singleton);
627626

628-
using (var scope = _provider.BeginLifetimeScope())
629-
{
630-
// Act && Assert
627+
using var scope = _provider.BeginLifetimeScope();
631628

632-
var ex = Assert.Throws<ActivationException>(() => scope.Resolver.Resolve<IFoo>());
633-
Assert.That(ex.Message,
634-
Does.StartWith("A lifestyle mismatch has been detected. Foo (Singleton) depends on IBar implemented by Bar (Transient)."));
635-
}
629+
// Act && Assert
630+
631+
var ex = Assert.Throws<ActivationException>(() => scope.Resolver.Resolve<IFoo>());
632+
Assert.That(ex.Message,
633+
Does.Contain("[Lifestyle Mismatch] Foo (Singleton) depends on IBar implemented by Bar (Transient)."));
636634
}
637635

638636
// Note: this behavior check is not available

src/Simplify.DI.Provider.SimpleInjector/SimpleInjectorDIProvider.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ public Container Container
2222
Options =
2323
{
2424
DefaultScopedLifestyle = new AsyncScopedLifestyle(),
25-
ResolveUnregisteredConcreteTypes = false
25+
UseStrictLifestyleMismatchBehavior = true
2626
}
2727
});
2828

src/Simplify.DI.Provider.SimpleInjector/Simplify.DI.Provider.SimpleInjector.csproj

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,17 +5,15 @@
55
<Product>Simplify</Product>
66
<Description>Simplify.DI SimpleInjector provider</Description>
77
<Copyright>Licensed under LGPL</Copyright>
8-
<Version>1.8.4</Version>
8+
<Version>1.9</Version>
99
<PackageProjectUrl>https://github.com/SimplifyNet/Simplify/wiki/Simplify.DI</PackageProjectUrl>
1010
<PackageIconUrl>https://raw.githubusercontent.com/SimplifyNet/Images/master/Logo.png</PackageIconUrl>
1111
<PublishRepositoryUrl>true</PublishRepositoryUrl>
1212
<PackageTags>.NET DI IOC-container-provider</PackageTags>
1313
<PackageReleaseNotes>
1414
Updates
15-
* Upgrade to Simplify.DI 4.0.3
16-
* Upgrade to SimpleInjector 4.10.2
17-
New
18-
* .NET Standard 2 exact support
15+
* Upgrade to Simplify.DI 4.0.4
16+
* Upgrade to SimpleInjector 5.0.1 (PR#138)
1917
</PackageReleaseNotes>
2018
<OutputPath>bin\Any CPU\$(Configuration)\</OutputPath>
2119
<EmbedUntrackedSources>true</EmbedUntrackedSources>
@@ -24,7 +22,7 @@
2422
<DocumentationFile>bin\Any CPU\$(Configuration)\$(TargetFramework)\Simplify.DI.Provider.SimpleInjector.xml</DocumentationFile>
2523
</PropertyGroup>
2624
<ItemGroup>
27-
<PackageReference Include="Simplify.DI" Version="4.0.3" />
25+
<PackageReference Include="Simplify.DI" Version="4.0.4" />
2826
<PackageReference Include="SimpleInjector" Version="5.0.1" />
2927
</ItemGroup>
3028
</Project>

0 commit comments

Comments
 (0)