-
-
Notifications
You must be signed in to change notification settings - Fork 119
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added support for Host.CreateApplicationBuilder() for .NET 8, added c…
…odegen support for Wolverine too
- Loading branch information
1 parent
fe74771
commit 58d9d52
Showing
6 changed files
with
95 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
52 changes: 52 additions & 0 deletions
52
src/Lamar.AspNetCoreTests/integration_with_host_application_builder.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
using System; | ||
using JasperFx.CodeGeneration.Model; | ||
using Lamar.IoC.Frames; | ||
using Lamar.Microsoft.DependencyInjection; | ||
using Microsoft.AspNetCore.Http.Features; | ||
using Microsoft.Extensions.DependencyInjection; | ||
using Microsoft.Extensions.Hosting; | ||
using Shouldly; | ||
using Xunit; | ||
|
||
namespace Lamar.AspNetCoreTests; | ||
|
||
#if NET8_0_OR_GREATER | ||
public class integration_with_host_application_builder : IDisposable | ||
{ | ||
private readonly IHost theHost; | ||
|
||
public integration_with_host_application_builder() | ||
{ | ||
theHost = Host.CreateApplicationBuilder() | ||
.UseLamar() | ||
.Build(); | ||
|
||
theHost.Start(); | ||
} | ||
|
||
public void Dispose() | ||
{ | ||
theHost?.Dispose(); | ||
} | ||
|
||
[Fact] | ||
public void should_be_using_lamar_as_the_container() | ||
{ | ||
theHost.Services.ShouldBeOfType<Container>(); | ||
} | ||
|
||
[Fact] | ||
public void should_register_IServiceProviderIsService() | ||
{ | ||
theHost.Services.GetRequiredService<IServiceProviderIsService>() | ||
.ShouldBeOfType<Container>(); | ||
} | ||
|
||
[Fact] | ||
public void should_register_IServiceVariableSource() | ||
{ | ||
theHost.Services.GetRequiredService<IServiceVariableSource>() | ||
.ShouldBeOfType<ServiceVariableSource>(); | ||
} | ||
} | ||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
src/Lamar.Microsoft.DependencyInjection/Lamar.Microsoft.DependencyInjection.csproj
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters